0

Time to time my initial page (login page) failing to load even if the waiting time increased. So my question is why sometimes it passes by and sometimes not , is that related to some external scrips or there something else?

enter image description here

     before(() => cy.fixture('users').then((u: { [key: string]: User }) => (user = u['preCreatedUser'])));

  beforeEach(() => {
    cy.visit(Route.LogIn);
    LogInPage.logIn(user.email, user.password);
  });

  it('should be able to create new btc crypto address', () => {
    TransactionsPage.myAssetsButton.should('contain.text', 'My assets').click();
    MyCryptoAddressesPage.chooseCryptoAssetTab('BTC');

    MyCryptoAddressesPage.addAddressButton.click();
    let rowCount: number;
    MyCryptoAddressesPage.tableRowCount.then((c) => (rowCount = c));
    AddWalletModal.selectAssetFromSelectorAndConfirm('BTC');
    // eslint-disable-next-line cypress/no-unnecessary-waiting
    cy.wait(3000);
    MyCryptoAddressesPage.tableRowCount.then((c) => expect(c).eq(rowCount + 1));
    MyCryptoAddressesPage.lastTableRowAmountColumn.then((c) => expect(+c.text()).to.eq(0));
  });

I have also attempted intercepting everything and wait for it, same issues , fails few times then work for two times then fails again, dont get it, can that be cookie session related?

beforeEach(() => {
    cy.intercept('GET', '**/config').as('dataRequest');
    cy.intercept('GET', '**/6241b4c7-311a-46e8-a005-7678b866b292').as('ddataRequest');
    cy.visit(Route.LogIn);
    cy.wait('@dataRequest');
    cy.wait('@ddataRequest');
    LogInPage.logIn(user.email, user.password);
  });
Artjom Prozorov
  • 167
  • 2
  • 10

0 Answers0