test: add tests for git connection (#1289)
* chore: add data-test attributes * test: add github connection test, add applications modal * chore: embed test GITHUB_CLIENT_* environment values --------- Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
This commit is contained in:
34
packages/e2e-tests/fixtures/applications-modal.js
Normal file
34
packages/e2e-tests/fixtures/applications-modal.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const { GithubPage } = require('./apps/github/github-page');
|
||||
const { BasePage } = require('./base-page');
|
||||
|
||||
export class ApplicationsModal extends BasePage {
|
||||
|
||||
applications = {
|
||||
github: GithubPage
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import('@playwright/test').Page} page
|
||||
*/
|
||||
constructor (page) {
|
||||
super(page);
|
||||
this.modal = page.getByTestId('add-app-connection-dialog');
|
||||
this.searchInput = page.getByTestId('search-for-app-text-field');
|
||||
this.appListItem = page.getByTestId('app-list-item');
|
||||
this.appLoader = page.getByTestId('search-for-app-loader');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string link
|
||||
*/
|
||||
async selectLink (link) {
|
||||
if (this.applications[link] === undefined) {
|
||||
throw {
|
||||
message: `Unknown link "${link}" passed to ApplicationsModal.selectLink`
|
||||
}
|
||||
}
|
||||
await this.searchInput.fill(link);
|
||||
await this.appListItem.first().click();
|
||||
return new this.applications[link](this.page);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user