feat: introduce playwright (#1194)
* feat: introduce playwright * test: migrate apps folder to playwright (#1201) * test: rewrite connections tests with playwright (#1203) * test: rewrite executions tests with playwright (#1207) * test: rewrite flow editor tests with playwright (#1212) * test(flow-editor): rewrite tests using serial mode (#1218) * test: update custom connection creation paths * test: move login logic to page fixture * test: remove cypress tests and deps --------- Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
// @ts-check
|
||||
const { test, expect } = require('../../fixtures/index');
|
||||
|
||||
test.describe('Connections page', () => {
|
||||
test.beforeEach(async ({ page, connectionsPage }) => {
|
||||
await page.getByTestId('apps-page-drawer-link').click();
|
||||
await page.goto('/app/ntfy/connections');
|
||||
});
|
||||
|
||||
test('shows connections if any', async ({ page, connectionsPage }) => {
|
||||
await page.getByTestId('apps-loader').waitFor({
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
await connectionsPage.screenshot({
|
||||
path: 'Connections.png',
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('can add connection', () => {
|
||||
test('has a button to open add connection dialog', async ({ page }) => {
|
||||
await expect(page.getByTestId('add-connection-button')).toBeVisible();
|
||||
});
|
||||
|
||||
test('add connection button takes user to add connection page', async ({
|
||||
page,
|
||||
connectionsPage,
|
||||
}) => {
|
||||
await connectionsPage.clickAddConnectionButton();
|
||||
await expect(page).toHaveURL('/app/ntfy/connections/add?shared=false');
|
||||
});
|
||||
|
||||
test('shows add connection dialog to create a new connection', async ({
|
||||
page,
|
||||
connectionsPage,
|
||||
}) => {
|
||||
await connectionsPage.clickAddConnectionButton();
|
||||
await expect(page).toHaveURL('/app/ntfy/connections/add?shared=false');
|
||||
await page.getByTestId('create-connection-button').click();
|
||||
await expect(
|
||||
page.getByTestId('create-connection-button')
|
||||
).not.toBeVisible();
|
||||
|
||||
await connectionsPage.screenshot({
|
||||
path: 'Ntfy connections after creating a connection.png',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user