Linden Crandall 5075f5c5d8
Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
commit upstream files
2025-02-06 04:14:18 +09:00

34 lines
983 B
JavaScript

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 = this.modal.getByTestId('search-for-app-text-field');
this.appListItem = this.modal.getByTestId('app-list-item');
this.appLoader = this.modal.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);
}
}