Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: playwright, puppteer, WDIO, and, WDJS tests #499

Merged
merged 12 commits into from
Apr 13, 2022
Merged

Conversation

Zidious
Copy link
Contributor

@Zidious Zidious commented Apr 7, 2022

Mostly, the pathing of the test fixtures were incorrect, so it was not testing the correct page.

straker
straker previously requested changes Apr 7, 2022
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this problem was caused by us not realizing that the pages we navigated to were returning 404s, I think we should take the extra time here and assert that the page is what we expect before running tests. Something like assert the title of the page or the status of the page should be sufficient.

const title = await page.title();
asset.equal(title, 'Nested Frames')

// or

const response = await page.goto(url);
asset.equal(response.status(), 200) 

Edit: I think asserting the status is probably the better solution

@Zidious
Copy link
Contributor Author

Zidious commented Apr 7, 2022

Unfortunately, WDJS' get returns undefined, doesn't appear to be a way to get the status code of a page (technically the page loaded, just with a 404).

Similarly, WDIO url returns a string[] which incorrect url path or not returns null, doesn't appear to be a way to check the status here either.

@Zidious Zidious changed the title fix: playwright, puppteer, WDIO, and, WDJS tests test: playwright, puppteer, WDIO, and, WDJS tests Apr 7, 2022
straker
straker previously requested changes Apr 8, 2022
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For wdjs and wdio you can assert that the title isn't "Error".

await client.url(`${addr}/doesnt-exist-frameset.html`);
const title = await client.getTitle();  // { title: 'Error' }
assert.notEqual(title, 'Error');

packages/webdriverjs/tests/axe-webdriverjs.spec.ts Outdated Show resolved Hide resolved
packages/webdriverjs/tests/axe-webdriverjs.spec.ts Outdated Show resolved Hide resolved
packages/webdriverjs/tests/axe-webdriverjs.spec.ts Outdated Show resolved Hide resolved
packages/webdriverjs/tests/axe-webdriverjs.spec.ts Outdated Show resolved Hide resolved
packages/webdriverjs/tests/axe-webdriverjs.spec.ts Outdated Show resolved Hide resolved
@Zidious Zidious merged commit 3e5407a into develop Apr 13, 2022
@Zidious Zidious deleted the fix/tests branch April 13, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants