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

feat(perform): test helper to use playwright commands in your tests #23

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

cristinecula
Copy link
Contributor

Usage example:

import { perform } from '@neovici/cfg/web/perform.js';
...
	test('can create pdf', async () => {
		const filename = await perform(async ({ page }) => {
			const downloadPromise = page.waitForEvent('download');
			await page.locator('button[title="Download images"]').click();
			const download = await downloadPromise;
			return download.suggestedFilename();
		});

		assert.equal(filename, 'archive.pdf');
	});

Usage example:

```js
import { perform } from '@neovici/cfg/web/perform.js';
...
	test('can create pdf', async () => {
		const filename = await perform(async ({ page }) => {
			const downloadPromise = page.waitForEvent('download');
			await page.locator('button[title="Download images"]').click();
			const download = await downloadPromise;
			return download.suggestedFilename();
		});

		assert.equal(filename, 'archive.pdf');
	});
```
@cristinecula cristinecula added the enhancement New feature or request label Dec 6, 2023
@cristinecula cristinecula requested a review from a team December 6, 2023 12:24
@cristinecula cristinecula self-assigned this Dec 6, 2023
@cristinecula cristinecula merged commit 81f798f into master Dec 6, 2023
1 check passed
Copy link

github-actions bot commented Dec 6, 2023

🎉 This PR is included in version 1.43.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@cristinecula cristinecula deleted the feature/perform branch December 6, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants