Skip to content

Commit

Permalink
feat(Tests):added withdraw test
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Jul 2, 2024
1 parent 881f2b9 commit 7d5a77e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
33 changes: 32 additions & 1 deletion tests/openstack_application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ test.describe.serial('@openstack_application', () => {
});
});

test.describe('Should withdraw a project extension for OpenStack', () => {
test.use({ storageState: Util.MEMBER_STORAGE });
test('Member @openstack_application', async ({ page, baseURL }) => {
const projectOverviewPage = new ProjectOverViewPage(page, baseURL);
await projectOverviewPage.goToProjectOverview(Util.OPENSTACK_APPLICATION_NAME);
await projectOverviewPage.withdrawtProjectExtension();
});
});
test.describe('Should request a project extension2 for OpenStack', () => {
test.use({ storageState: Util.MEMBER_STORAGE });
test('Member @openstack_application', async ({ page, baseURL }) => {
const projectOverviewPage = new ProjectOverViewPage(page, baseURL);
await projectOverviewPage.goToProjectOverview(Util.OPENSTACK_APPLICATION_NAME);
await projectOverviewPage.requestProjectExtension(false);
});
});
test.describe('Should request a project modification for OpenStack', () => {
test.use({ storageState: Util.MEMBER_STORAGE });
test('Member @openstack_application', async ({ page, baseURL }) => {
Expand All @@ -70,7 +86,22 @@ test.describe.serial('@openstack_application', () => {
await projectOverviewPage.requestProjectModification(false);
});
});

test.describe('Should withdraw a project modification for OpenStack', () => {
test.use({ storageState: Util.MEMBER_STORAGE });
test('Member @openstack_application', async ({ page, baseURL }) => {
const projectOverviewPage = new ProjectOverViewPage(page, baseURL);
await projectOverviewPage.goToProjectOverview(Util.OPENSTACK_APPLICATION_NAME);
await projectOverviewPage.withdrawtProjectModification();
});
});
test.describe('Should request a project modification2 for OpenStack', () => {
test.use({ storageState: Util.MEMBER_STORAGE });
test('Member @openstack_application', async ({ page, baseURL }) => {
const projectOverviewPage = new ProjectOverViewPage(page, baseURL);
await projectOverviewPage.goToProjectOverview(Util.OPENSTACK_APPLICATION_NAME);
await projectOverviewPage.requestProjectModification(false);
});
});
test.describe('Should approve a project extension for OpenStack', () => {
test.use({ storageState: Util.VO_MANAGER_STORAGE });
test('VO @openstack_application', async ({ page, baseURL }) => {
Expand Down
27 changes: 26 additions & 1 deletion tests/page_objects/project_overview.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export class ProjectOverViewPage {

// MODIFICATIONS
private OPEN_EXTENSION_REQUEST_BUTTON: string = 'open_extension_request_button';
private CONFIRM_WITHDRAW_BTN: string = 'confirm_withdraw_btn';
private SHOW_LIFETIME_EXTENSIO_WITHDRAW_BUTTON: string = 'show_lifetime_extension_withdraw_button';
private SHOW_MODIFICATION_EXTENSION_WITHDRAW_BUTTON: string = 'show_modification_extension_withdraw_button';
private OPEN_MODIFICATION_REQUEST_BUTTON: string = 'open_modification_request_button';
private OPEN_TERMINATION_REQUEST_BUTTON: string = 'open_termination_request_button';
private DECLINE_NEW_PUBLICATION_BUTTON: string = 'decline_publication_button';
Expand Down Expand Up @@ -78,7 +81,8 @@ export class ProjectOverViewPage {
console.log(`Project ${project_name} should be visible!`);

await this.page
.locator(Util.by_data_test_id_str_prefix(`${this.PROJECT_OVERVIEW_BUTTON_PREFIX}${project_name}`)).first()
.locator(Util.by_data_test_id_str_prefix(`${this.PROJECT_OVERVIEW_BUTTON_PREFIX}${project_name}`))
.first()
.click();

console.log(this.page.url());
Expand All @@ -104,6 +108,27 @@ export class ProjectOverViewPage {
);
}

async withdrawtProjectExtension() {
console.log('Withdraw extension request');

// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
await this.page.locator(Util.by_data_test_id_str(this.SHOW_LIFETIME_EXTENSIO_WITHDRAW_BUTTON)).click();
await this.page.locator(Util.by_data_test_id_str(this.CONFIRM_WITHDRAW_BTN)).click();
await this.page.waitForSelector(Util.by_data_test_id_str(this.SHOW_LIFETIME_EXTENSIO_WITHDRAW_BUTTON), {
state: 'hidden',
});
}

async withdrawtProjectModification() {
console.log('Withdraw modification request');
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
await this.page.locator(Util.by_data_test_id_str(this.SHOW_MODIFICATION_EXTENSION_WITHDRAW_BUTTON)).click();
await this.page.locator(Util.by_data_test_id_str(this.CONFIRM_WITHDRAW_BTN)).click();
await this.page.waitForSelector(Util.by_data_test_id_str(this.SHOW_MODIFICATION_EXTENSION_WITHDRAW_BUTTON), {
state: 'hidden',
});
}

async requestProjectModification(simpleVM: boolean) {
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
simpleVM
Expand Down

0 comments on commit 7d5a77e

Please sign in to comment.