Hi,
I've written this test case:
const getURL = ClientFunction(() => window.location.href);
test ('test', async t => {
await page1.gotoSecondPage();
await t
.click(page2.find('span a'))
.expect(helloPage().helloWindow.withExactText('hello message'))
.ok('Hello window is opened');
const url = await getURL();
await t.expect(url).eql(helloWindowURL, 'Link is correct');
})
.after (async t => {
await t.navigateTo(page1);
await page1.selectElement1();
await page1.selectElement2();
});
I have 3 pages and links between them are page1 => page2 => helloPage
My intention is checking link which should be opened from second page.
The problem is my test fails sometimes with an error:
AssertionError: Link is correct: expected 'http://page2' to deeply equal 'http://helloPage'
But it's impossible because before link checking I check element on helloPage, so it should be opened already.
I really don't understand why it happens. Do you have any idea?
Btw, on my local machine I can't reproduce this problem.
For remote machine my run command is:
testcafe chrome,opera,firefox -c 2 src/tests -r spec,nunit:results/nunit-results.xml -S -s logs/screenshots
Thank you.