test: rewrite connections tests with playwright (#1203)
This commit is contained in:
16
packages/e2e-tests/fixtures/connections-page.js
Normal file
16
packages/e2e-tests/fixtures/connections-page.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const path = require('node:path');
|
||||
const { BasePage } = require('./base-page');
|
||||
|
||||
export class ConnectionsPage extends BasePage {
|
||||
async screenshot(options = {}) {
|
||||
const { path: plainPath, ...restOptions } = options;
|
||||
|
||||
const computedPath = path.join('connections', plainPath);
|
||||
|
||||
return await super.screenshot({ path: computedPath, ...restOptions });
|
||||
}
|
||||
|
||||
async clickAddConnectionButton() {
|
||||
await this.page.getByTestId('add-connection-button').click();
|
||||
}
|
||||
}
|
@@ -1,9 +1,13 @@
|
||||
const base = require('@playwright/test');
|
||||
const { ApplicationsPage } = require('./applications-page');
|
||||
const { ConnectionsPage } = require('./connections-page');
|
||||
|
||||
exports.test = base.test.extend({
|
||||
applicationsPage: async ({ page }, use) => {
|
||||
await use(new ApplicationsPage(page));
|
||||
},
|
||||
connectionsPage: async ({ page }, use) => {
|
||||
await use(new ConnectionsPage(page));
|
||||
},
|
||||
});
|
||||
exports.expect = base.expect;
|
||||
|
Reference in New Issue
Block a user