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

docs(contributing): add info about skip and fail #1944

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

rwoll
Copy link
Member

@rwoll rwoll commented Apr 23, 2020

When contributing some test cases, I was a bit confused about if I should use skip and fail, the difference between the two, and how they interact with CI/CD tests passing or failing: #1939 (comment).

This is my attempt at explaining the difference, but feel free to edit to make it more clear and concise (and correct any inaccuracies).

where `condition` is usually a certain browser like `FFOX` (for Firefox),
`WEBKIT` (for WebKit), and `CHROMIUM` (for Chromium).

For example, the [alt-click downloads test](https://github.com/microsoft/playwright/blob/471ccc72d3f0847caa36f629b394a028c7750d93/test/download.spec.js#L86) is marked
Copy link
Member Author

Choose a reason for hiding this comment

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

I think pointing to a concrete (permalinked) example is helpful, but this may throw people off about alt-click download once Playwright is fixed to support alt-click in WebKit and Chromium.

Consider adding a completely fiction example like:

it.fail(CHROMIUM)('should do exciting things', async({page, server} => {
     const excitingThings = await page.excitingThings()
     expect(excitingThings).toBeTruthy()
}))

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's a good point. On the other hand as long as it points to a particular revision of the file and not break over time I think it's ok. We can iterate on this later if it's unsatisfactory.

@@ -198,6 +198,26 @@ HEADLESS=false SLOW_MO=500 npm run wtest
BROWSER=chromium node --inspect-brk test/test.js
```

- When should a test be marked with `skip` or `fail`?
Copy link
Member Author

Choose a reason for hiding this comment

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

I did not comment about how these interact with CI/CD of an MR passing/failing. It may be helpful to add that, too.

@aslushnikov aslushnikov merged commit fd17cfb into microsoft:master Apr 23, 2020
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.

3 participants