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:
Rıdvan Akca
2023-08-18 00:31:38 +03:00
committed by GitHub
parent 590780a539
commit dace794167
29 changed files with 709 additions and 813 deletions

View File

@@ -0,0 +1,66 @@
// @ts-check
const { test, expect } = require('../../fixtures/index');
test.describe('Apps page', () => {
test.beforeEach(async ({ page, applicationsPage }) => {
await page.getByTestId('apps-page-drawer-link').click();
});
test('displays applications', async ({ page, applicationsPage }) => {
await page.getByTestId('apps-loader').waitFor({
state: 'detached',
});
await expect(page.getByTestId('app-row')).not.toHaveCount(0);
await applicationsPage.screenshot({
path: 'Applications.png',
});
});
test.describe('can add connection', () => {
test.beforeEach(async ({ page }) => {
await expect(page.getByTestId('add-connection-button')).toBeVisible();
await page.getByTestId('add-connection-button').click();
await page
.getByTestId('search-for-app-loader')
.waitFor({ state: 'detached' });
});
test('lists applications', async ({ page, applicationsPage }) => {
const appListItemCount = await page.getByTestId('app-list-item').count();
expect(appListItemCount).toBeGreaterThan(10);
await applicationsPage.clickAway();
});
test('searches an application', async ({ page, applicationsPage }) => {
await page.getByTestId('search-for-app-text-field').fill('DeepL');
await expect(page.getByTestId('app-list-item')).toHaveCount(1);
await applicationsPage.clickAway();
});
test('goes to app page to create a connection', async ({
page,
applicationsPage,
}) => {
await page.getByTestId('app-list-item').first().click();
await expect(page).toHaveURL('/app/deepl/connections/add?shared=false');
await expect(page.getByTestId('add-app-connection-dialog')).toBeVisible();
await applicationsPage.clickAway();
});
test('closes the dialog on backdrop click', async ({
page,
applicationsPage,
}) => {
await page.getByTestId('app-list-item').first().click();
await expect(page).toHaveURL('/app/deepl/connections/add?shared=false');
await expect(page.getByTestId('add-app-connection-dialog')).toBeVisible();
await applicationsPage.clickAway();
await expect(page).toHaveURL('/app/deepl/connections');
await expect(page.getByTestId('add-app-connection-dialog')).toBeHidden();
});
});
});