vendredi 18 septembre 2020

Can TestCafe follow a sequence through multiple pages?

I am very new to TestCafe, (but excited by what I see) so this might be a dumb mistake. All the examples of TestCafe that I have found, depend on a single URL. However, I want to test a very familiar sequence:

  1. user makes some choices in page X and clicks submit,
  2. user is shown multiple matching records in page Y, and clicks something in one result,
  3. user sees a detail page Z, with full information for one record

When I try this in TestCafe, my test terminates when control leaves X. It never sees Y. So, in the last lines of my test, after it submits page X

   await t 
      .click(submitButton); 

.. if I look for values which should be in page Y,

   await t 
      .expect(Selector('#back-to-home-page').innerText)
      .contains ('Back to Page X');

the Selector cannot find them. It only finds things still in page X. (I have testcafe v 6.14, but this is not version-specific). Thank you.

Aucun commentaire:

Enregistrer un commentaire