Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test vsam stcs tabs #247

Merged
merged 17 commits into from
Nov 13, 2024
149 changes: 146 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"electron-store": "^8.1.0",
"flat": "^5.0.2",
"js-yaml": "^4.1.0",
"node-ssh": "^13.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
Expand Down
66 changes: 45 additions & 21 deletions playwright_test/Pages/apfAuth.page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/apfAuth.page.ts

View workflow job for this annotation

GitHub Actions / lint

missing header

Check warning on line 1 in playwright_test/Pages/apfAuth.page.ts

View workflow job for this annotation

GitHub Actions / lint

'electron' is defined but never used
let electronApp: ElectronApplication

Check warning on line 2 in playwright_test/Pages/apfAuth.page.ts

View workflow job for this annotation

GitHub Actions / lint

'electronApp' is defined but never used

class ApfAuthPage{
page: Page;
Expand Down Expand Up @@ -51,24 +51,26 @@
this.page = page;
this.continueButtonSelector = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium')
this.userNameInputSelector = page.locator('label:has-text("User Name") + div input#standard-required')
this.writeConfig_greenCheckXpath = page.locator('#card-download-progress-card svg.MuiSvgIcon-colorSuccess')
this.uploadYaml_greenCheckXpath = page.locator('#card-download-progress-card svg.MuiSvgIcon-colorSuccess')
this.init_apfauth_greenCheckXpath = page.locator("#card-upload-progress-card svg.MuiSvgIcon-colorSuccess")
this.writeConfig_greenCheckXpath = page.locator('//*[@id="box-download-progress-card"][1]')
this.uploadYaml_greenCheckXpath = page.locator('//*[@id="box-download-progress-card"][2]')
this.init_apfauth_greenCheckXpath = page.locator('//*[@id="card-upload-progress-card"]')
this.previous_step_button = page.locator('//button[contains(text(),"Previous step")]')
this.skip_installation_button = page.locator('//button[contains(text(),"Skip")]')
this.skip_apf_auth_button = page.locator('//button[contains(text(),"Skip")]')
this.continue_apfauth_setup = page.locator('//button[contains(text(),"Continue to APF Auth Setup")]')
this.continue_security_setup = page.locator('//button[contains(text(),"Continue to Security Setup")]')
this.editor_title_element = page.locator('//h2[text()="Editor"]')
this.APFAUTH_TITLE = page.locator('APF Authorize Load Libraries')
this.APFAUTH_TITLE = page.locator('//*[@id="container-box-id"]/form/div/div[1]/div')
this.installationTitle = page.locator('//div[text()="Installation"]')
this.NETWORKING_TITLE = page.locator(' //div[text()="Networking"]');
this.licenseAgreement = page.locator('//button[contains(text(), "License Agreement")]')
this.acceptLicense = page.locator('//html/body/div[2]/div[3]/div/div[2]/button[1]')
this.continueToComponentInstallation = page.locator('//button[contains(text(), "Continue to Components Installation")]')
this.datasetPrefix = page.getByLabel('Prefix')
this.authLoadLib = page.getByLabel('Auth Loadlib')
this.authpluginLib = page.getByLabel('Auth Plugin Lib')
this.click_ApfAuth = page.locator('//span[text()="Apf Auth"]');
this.datasetPrefix = page.locator("//label[text()='Prefix']//following-sibling::div/input")
this.authLoadLib = page.locator("//label[text()='Auth Loadlib']//following-sibling::div/input")
this.authpluginLib = page.locator("//label[text()='Auth Plugin Lib']//following-sibling::div/input")
this.click_ApfAuth = page.locator('//span[text()="APF Auth"]');
this.click_Installation = page.locator('//span[text()="Installation"]')
this.skipInstallation = page.locator('//button[contains(text(),"Skip")]')
this.run_zwe_init_apfauth = page.locator('//button[contains(text(),"zwe init apfauth")]')
this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]')
Expand All @@ -77,7 +79,7 @@
this.save_and_close = page.locator('//button[contains(text(),"Save & close")]')
this.previous_step = page.locator('//button[contains(text(),"Previous step")]')
this.skip_apf_auth = page.locator('//button[contains(text(),"Skip")]')
this.initApfauth = page.locator('//button[contains(text(),"zwe init apfauth")]')
this.initApfauth = page.locator('//button[contains(text(),"Initialize APF Authorizations")]')
this.close_button = page.locator('//button[contains(text(), "Close")]')
this.securityTab_title = page.locator('//div[text()="Security"]')
this.dataset_prefix_value = page.getByLabel('Dataset Prefix')
Expand All @@ -94,28 +96,50 @@
}

async movetoApfAuthPage(){
await this.page.waitForTimeout(500)
await this.click_ApfAuth.click({timeout: 9000})
}


async movetoInstallationPage(){
await this.page.waitForTimeout(5000)
await this.click_Installation.click({timeout: 9000})
}
async isContinueButtonEnabled(){
return await this.continue_security_setup.isEnabled();
}
async selectInstallationType(){
await this.select_SMPE.waitFor({ state: 'visible', timeout: 9000 }); // Adjust timeout if needed
console.log('SMP/E span is visible.');
await this.select_SMPE.click({timeout: 9000})
}

async movetoInstallationPage(){
await this.licenseAgreement.click({timeout: 9000})
await this.acceptLicense.click({timeout: 9000})
await this.continueToComponentInstallation.click({timeout: 5000})
}

async fillApfDetails(datasetPrefix:string, authLoadLib:string,authpluginLib:string){
await this.datasetPrefix.fill(datasetPrefix,{ timeout: 10000 })
await this.authLoadLib.fill(authLoadLib,{ timeout: 10000 })
await this.authpluginLib.fill(authpluginLib,{ timeout: 10000 })
await this.page.waitForTimeout(500)
await this.datasetPrefix.fill(datasetPrefix);
await this.page.waitForTimeout(500)
await this.authLoadLib.fill(authLoadLib);
await this.authpluginLib.fill(authpluginLib);
await this.page.waitForTimeout(5000)

Check failure on line 123 in playwright_test/Pages/apfAuth.page.ts

View workflow job for this annotation

GitHub Actions / lint

Mixed spaces and tabs

}
async initializeApfauth(){
await this.initApfauth.click()
await this.waitForContinueButtonToBeEnabled();
}

private async waitForContinueButtonToBeEnabled(): Promise<void> {
const timeout = 1000000;
const interval = 500;
const endTime = Date.now() + timeout;
while (Date.now() < endTime) {
if (await this.isContinueButtonEnabled()) {
return;
}
await this.page.waitForTimeout(interval);
}

throw new Error('Continue button was not enabled within the timeout period');
}
async isWriteConfigGreenCheckVisible(){
return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 });
Expand All @@ -132,8 +156,8 @@

async returnTitleOfPrevPage(){
await this.previous_step_button.click({ timeout: 2000 });
const installation_title = await this.installationTitle.textContent();
return installation_title;
const networking_title = await this.NETWORKING_TITLE.textContent();
return networking_title;
}
async viewYaml(){
await this.view_yaml.click({ timeout: 2000 })
Expand Down Expand Up @@ -185,4 +209,4 @@


}
export default ApfAuthPage;
export default ApfAuthPage;
8 changes: 5 additions & 3 deletions playwright_test/Pages/connection.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page,Locator } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/connection.page.ts

View workflow job for this annotation

GitHub Actions / lint

missing header

class ConnectionPage{
page: Page;
Expand Down Expand Up @@ -59,14 +59,15 @@

async SubmitValidateCredential(){
console.log("Submitting credentials...");
await this.page.waitForTimeout(1000);
await this.validateCredential.click();
await this.page.waitForTimeout(5000);
console.log("Credentials submitted.");
}

async clickContinueButton() {
await this.page.waitForTimeout(1000);
return await this.continueButton.click();
await this.continueButton.click();

}

async click_saveAndClose(){
Expand All @@ -75,9 +76,10 @@
async isContinueButtonVisible() {
return await this.continueButton.isDisabled();
}

async isGreenCheckIconVisible() {
return await this.greenCheckIconSelector.isHidden();
}
}

export default ConnectionPage;
export default ConnectionPage;
Loading
Loading