From 99f573432642d633d83d0b2aef673fccf5ca7645 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Thu, 24 Oct 2024 18:08:53 +0530 Subject: [PATCH 1/7] Added Review Page Tests Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 195 ++++++----- playwright_test/Pages/certificates.page.ts | 97 ++++++ playwright_test/Pages/common.page.ts | 39 +++ playwright_test/Pages/connection.page.ts | 10 +- playwright_test/Pages/installation.page.ts | 59 ++-- playwright_test/Pages/launchConfig.page.ts | 242 +++++++------- playwright_test/Pages/planning.page.ts | 20 +- playwright_test/Pages/review.page.ts | 190 +++++++++++ playwright_test/Pages/security.page.ts | 258 ++++++++------- playwright_test/Pages/title.page.ts | 21 +- playwright_test/Tests/ApfAuth.spec.ts | 361 ++++++++++----------- playwright_test/Tests/Installation.spec.ts | 89 +++-- playwright_test/Tests/Networking.spec.ts | 164 +++++----- playwright_test/Tests/Review.spec.ts | 239 ++++++++++++++ playwright_test/Tests/Security.spec.ts | 332 ++++++++++--------- playwright_test/utils/config.ts | 5 +- 16 files changed, 1443 insertions(+), 878 deletions(-) create mode 100644 playwright_test/Pages/certificates.page.ts create mode 100644 playwright_test/Pages/common.page.ts create mode 100644 playwright_test/Pages/review.page.ts create mode 100644 playwright_test/Tests/Review.spec.ts diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index ab389ffa..2c1f3418 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -1,8 +1,9 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class ApfAuthPage{ +class ApfAuthPage { page: Page; + pageTitle: Locator; continueButtonSelector: Locator; userNameInputSelector: Locator; writeConfig_greenCheckXpath: Locator; @@ -13,7 +14,6 @@ class ApfAuthPage{ skip_apf_auth_button: Locator; continue_apfauth_setup: Locator; continue_security_setup: Locator; - continueButtonSelector: Locator; editor_title_element: Locator; installationTitle: Locator; APFAUTH_TITLE: Locator; @@ -23,32 +23,29 @@ class ApfAuthPage{ licenseAgreement: Locator; acceptLicense: Locator; datasetPrefix: Locator; - authLoadLib:Locator; + authLoadLib: Locator; authpluginLib: Locator; - skipInstallation:Locator; - run_zwe_init_apfauth:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - skip_apf_auth:Locator; - previous_step:Locator; - securityTab_title:Locator; - initApfauth:Locator; - close_button:Locator; - securityTab_title:Locator; - auth_load_lib_value:Locator; - auth_plugin_lib_value:Locator; - dataset_prefix_value:Locator; - - - - - - + skipInstallation: Locator; + run_zwe_init_apfauth: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + skip_apf_auth: Locator; + previous_step: Locator; + securityTab_title: Locator; + initApfauth: Locator; + close_button: Locator; + auth_load_lib_value: Locator; + auth_plugin_lib_value: Locator; + dataset_prefix_value: Locator; + click_ApfAuth: Locator; + viewAndSubmitJob: Locator; + continueToComponentInstallation: Locator; constructor(page: Page) { this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") 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') @@ -70,11 +67,11 @@ class ApfAuthPage{ this.authpluginLib = page.getByLabel('Auth Plugin Lib') this.click_ApfAuth = page.locator('//span[text()="Apf Auth"]'); 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")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.run_zwe_init_apfauth = page.locator('//button[contains(text(),"zwe init apfauth")]') + this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + 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")]') @@ -83,106 +80,98 @@ class ApfAuthPage{ this.dataset_prefix_value = page.getByLabel('Dataset Prefix') this.auth_load_lib_value = page.getByLabel('APF Authorized Load Library') this.auth_plugin_lib_value = page.getByLabel('Zowe ZIS Plugins Load Library') - - //this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]') - this.select_SMPE = page.locator('span:has-text("SMP/E")'); - - } - async returnTitleOfApfAuthPage(){ - const ApfAuthTitle = await this.APFAUTH_TITLE.textContent(); - return ApfAuthTitle; } - async movetoApfAuthPage(){ - await this.click_ApfAuth.click({timeout: 9000}) + commonPage = new CommonPage(); + + async getApfAuthPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); } - - 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 movetoApfAuthPage() { + await this.commonPage.waitForElement(this.click_ApfAuth) + await this.click_ApfAuth.click({ timeout: 9000 }) } - - async movetoInstallationPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.continueToComponentInstallation.click({timeout: 5000}) + + 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 }) + 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 }) } - async initializeApfauth(){ - await this.initApfauth.click() + async initializeApfauth() { + await this.initApfauth.click() } - async isWriteConfigGreenCheckVisible(){ - return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); + async isWriteConfigGreenCheckVisible() { + return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isUploadConfigGreenCheckVisible(){ - return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); + async isUploadConfigGreenCheckVisible() { + return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isInitApfGreenCheckVisible(){ - return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 }); + async isInitApfGreenCheckVisible() { + return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable() { + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage(){ - await this.previous_step_button.click({ timeout: 2000 }); - const installation_title = await this.installationTitle.textContent(); - return installation_title; + async returnTitleOfPrevPage() { + await this.previous_step_button.click({ timeout: 2000 }); + const installation_title = await this.installationTitle.textContent(); + return installation_title; } - async viewYaml(){ - await this.view_yaml.click({ timeout: 2000 }) + async viewYaml() { + await this.view_yaml.click({ timeout: 2000 }) } - async closeButton(){ - await this.close_button.click({ timeout: 5000 }) + async closeButton() { + await this.close_button.click({ timeout: 5000 }) } - async click_viewAndSubmitJob(){ - await this.viewAndSubmitJob.click({ timeout: 6000 }) + async click_viewAndSubmitJob() { + await this.viewAndSubmitJob.click({ timeout: 6000 }) } - async click_previewJob(){ - await this.view_job_output.click({ timeout: 6000 }) + async click_previewJob() { + await this.view_job_output.click({ timeout: 6000 }) } - async is_skipApfAuthButtonEnable(){ - return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 }); + async is_skipApfAuthButtonEnable() { + return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 }); } - async click_skipApfAuth(){ - await this.skip_apf_auth_button.click({ timeout: 2000 }); - const securityPage_title = await this.securityTab_title.textContent(); - return securityPage_title; + async click_skipApfAuth() { + await this.skip_apf_auth_button.click({ timeout: 2000 }); + const securityPage_title = await this.securityTab_title.textContent(); + return securityPage_title; } - async open_monacoEditor(){ - this.view_yaml.click({ timeout: 2000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor() { + this.view_yaml.click({ timeout: 2000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable(){ - return await this.continue_security_setup.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + return await this.continue_security_setup.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose() { + this.save_and_close.click({ timeout: 2000 }) } - async get_datasetPrefix_value(){ - const dataset_prefix = await this.dataset_prefix_value.textContent(); - return dataset_prefix; + async get_datasetPrefix_value() { + const dataset_prefix = await this.dataset_prefix_value.textContent(); + return dataset_prefix; } - async get_authPluginLib_value(){ - const authPluginLib_value = await this.auth_plugin_lib_value.textContent(); - return authPluginLib_value; + async get_authPluginLib_value() { + const authPluginLib_value = await this.auth_plugin_lib_value.textContent(); + return authPluginLib_value; } - async get_authLoadLib_value(){ - const authPluginLib_value = await this.auth_load_lib_value.textContent(); - return authPluginLib_value; + async get_authLoadLib_value() { + const authPluginLib_value = await this.auth_load_lib_value.textContent(); + return authPluginLib_value; } - - } - export default ApfAuthPage; \ No newline at end of file +export default ApfAuthPage; \ No newline at end of file diff --git a/playwright_test/Pages/certificates.page.ts b/playwright_test/Pages/certificates.page.ts new file mode 100644 index 00000000..c487ff84 --- /dev/null +++ b/playwright_test/Pages/certificates.page.ts @@ -0,0 +1,97 @@ +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; + +class CertificatesPage { + page: Page; + pageTitle: Locator; + viewEditYaml: Locator; + viewSubmitJob: Locator; + viewJobOutput: Locator; + saveAndClose: Locator; + previousStep: Locator; + skipCertificates: Locator; + continueToLaunchSetup: Locator; + editorTitleElement: Locator; + closeEditorButton: Locator; + + constructor(page: Page) { + this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") + this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") + this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") + this.viewJobOutput = page.locator("//button[text()='View Job Output']") + this.saveAndClose = page.locator("//button[text()='Save & close']") + this.previousStep = page.locator("//button[text()='Previous step']") + this.skipCertificates = page.locator("//button[contains(text(),'Skip')]") + this.continueToLaunchSetup = page.locator("//button[text()='Continue to Launch Setup']") + this.editorTitleElement = page.locator("//h2[text()='Editor']") + this.closeEditorButton = page.locator("//button[text()='Close']") + } + + commonPage = new CommonPage(); + + async getCertificatesPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); + } + + async clickViewEditYaml() { + await this.commonPage.waitForElement(this.viewEditYaml) + await this.viewEditYaml.click(); + } + + async clickViewSubmitJob() { + await this.commonPage.waitForElement(this.viewSubmitJob) + await this.viewSubmitJob.click(); + } + + async clickViewJobOutput() { + await this.commonPage.waitForElement(this.viewJobOutput) + await this.viewJobOutput.click(); + await this.page.waitForTimeout(2000); + } + + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); + } + + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) + await this.previousStep.click(); + } + + async clickSkipCertificates() { + await this.commonPage.waitForElement(this.skipCertificates) + await this.skipCertificates.click(); + } + + async clickContinueToLaunchSetup() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) + await this.continueToLaunchSetup.click(); + } + + async isContinueToLaunchSetupDisabled() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) + return await this.continueToLaunchSetup.isDisabled() + } + + async isContinueToLaunchSetupEnabled() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) + return await this.continueToLaunchSetup.isEnabled() + } + + async open_monacoEditor() { + await this.commonPage.waitForElement(this.viewEditYaml) + this.viewEditYaml.click({ timeout: 2000 }) + await this.commonPage.waitForElement(this.editorTitleElement) + const editor_title = await this.editorTitleElement.textContent(); + return editor_title; + } + + async clickCloseEditor() { + await this.commonPage.waitForElement(this.closeEditorButton) + await this.closeEditorButton.click(); + } +} +export default CertificatesPage; \ No newline at end of file diff --git a/playwright_test/Pages/common.page.ts b/playwright_test/Pages/common.page.ts new file mode 100644 index 00000000..624969d8 --- /dev/null +++ b/playwright_test/Pages/common.page.ts @@ -0,0 +1,39 @@ +import { Page, Locator, expect } from '@playwright/test'; + +class CommonPage { + page: Page; + + async getElementValue(element: Locator) { + const elementValue = await element.getAttribute('value') + return elementValue + } + + async isElementHasValue(element: Locator): Promise { + const elementValue = await element.getAttribute('value') + if (elementValue !== null && elementValue !== '') { + return true + } else { + return false + } + } + + async validateElementValue(textBoxLocator: Locator, expectedValue: string): Promise { + const insertedValue = await textBoxLocator.inputValue(); + return insertedValue === expectedValue; + } + + async waitForElement(locator: Locator) { + try { + await this.page.waitForTimeout(1000); + await locator.waitFor({ state: 'visible', timeout: 10000 }); + // await expect(locator).toBeVisible(); + } catch (error) { + console.error('Error while checking visibility of locator', error); + return false; + } + await this.page.waitForTimeout(2000); + } + +} + +export default CommonPage; \ No newline at end of file diff --git a/playwright_test/Pages/connection.page.ts b/playwright_test/Pages/connection.page.ts index 8e3085f3..12c92311 100644 --- a/playwright_test/Pages/connection.page.ts +++ b/playwright_test/Pages/connection.page.ts @@ -20,8 +20,6 @@ class ConnectionPage{ this.validateCredential = page.locator("//button[contains(text(), 'Validate credentials')]") this.connectionPageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') - this.resumeProgress = page.locator('//button[contains(text(),"Resume Progress")]') this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') this.greenCheckIconSelector = page.locator('.MuiContainer-root svg[data-testid="CheckCircleIcon"]') } @@ -57,6 +55,11 @@ class ConnectionPage{ return await this.connectionPageTitle.textContent(); } + async fillPassword(password: string){ + await this.page.waitForTimeout(1000); + await this.password.fill(password); + } + async SubmitValidateCredential(){ console.log("Submitting credentials..."); await this.page.waitForTimeout(1000); @@ -69,9 +72,6 @@ class ConnectionPage{ return await this.continueButton.click(); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 5000 }) - } async isContinueButtonVisible() { return await this.continueButton.isDisabled(); } diff --git a/playwright_test/Pages/installation.page.ts b/playwright_test/Pages/installation.page.ts index ee8a1753..ba2fbe7a 100644 --- a/playwright_test/Pages/installation.page.ts +++ b/playwright_test/Pages/installation.page.ts @@ -29,17 +29,17 @@ class InstallationPage{ this.procLib = page.locator("//label[text()='Proclib']//following-sibling::div/input") this.parmLib = page.locator("//label[text()='Parmlib']//following-sibling::div/input") this.zis = page.locator("//label[text()='Zis']//following-sibling::div/input") - this.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") - this.loadLib = page.locator("//label[text()='Loadlib']//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.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") - this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") - this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") - this.viewJobOutput = page.locator("//button[text()='View Job Output']") + this.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") + this.loadLib = page.locator("//label[text()='Loadlib']//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.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") + this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") + this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") + this.viewJobOutput = page.locator("//button[text()='View Job Output']") this.saveAndClose = page.locator("//button[text()='Save & close']") this.previousStep = page.locator("//button[text()='Previous step']") - this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") + this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") this.continueToNetworkSetup = page.locator("//button[text()='Continue to Network Setup']") this.editorTitleElement = page.locator("//h2[text()='Editor']") this.closeEditorButton = page.locator("//button[text()='Close']") @@ -58,17 +58,17 @@ class InstallationPage{ async getPrefixValue(): Promise { return await this.prefix.inputValue(); } - + async enterProcLib(proclib: string): Promise { await this.page.waitForTimeout(500) await this.procLib.fill(proclib); } - + async getProclibValue(): Promise { return await this.procLib.inputValue(); } - + async enterParmLib(parmlib: string): Promise{ await this.page.waitForTimeout(500) await this.parmLib.fill(parmlib); @@ -155,18 +155,18 @@ class InstallationPage{ async isContinueToNetworkSetupEnabled(){ return await this.continueToNetworkSetup.isEnabled() } - + async isSkipToNetworkSetupEnabled(){ return await this.skipInstallation.isEnabled() } - + private async waitForContinueButtonToBeEnabled(): Promise { - const timeout = 100000; - const interval = 500; + const timeout = 100000; + const interval = 500; const endTime = Date.now() + timeout; while (Date.now() < endTime) { if (await this.isContinueToNetworkSetupEnabled()) { - return; + return; } await this.page.waitForTimeout(interval); } @@ -185,23 +185,20 @@ class InstallationPage{ await this.page.waitForTimeout(500) await this.closeEditorButton.click(); } - + async clickInstallMvsDatasetsInvalid(){ await this.installMVSDatasets.click(); } - - async fillAllFields(datasetPrefix: string, parmLib: string, procLib: string, jclLib: string, loadLib: string, authLoadLib: string, authPluginLib: string){ - await this.enterPrefix(datasetPrefix); - await this.enterParmLib(parmLib); - await this.enterProcLib(procLib); - await this.enterJclLib(jclLib); - await this.enterLoadLib(loadLib); - await this.enterAuthLoadLib(authLoadLib); - await this.enterAuthPluginLib(authPluginLib); - await this.enterAuthLoadLib(authLoadLib); - await this.enterAuthPluginLib(authPluginLib); - await this.enterAuthLoadLib(authLoadLib); - await this.enterAuthPluginLib(authPluginLib); + + async fillInstallationPageDetails(DATASET_PREFIX: string, PROC_LIB: string, PARM_LIB: string, ZIS: string, JCL_LIB: string, LOAD_LIB: string, AUTH_LOAD_LIB: string, AUTH_PLUGIN_LIB: string) { + await this.enterPrefix(DATASET_PREFIX) + await this.enterProcLib(PROC_LIB) + await this.enterParmLib(PARM_LIB) + await this.enterZis(ZIS) + await this.enterJclLib(JCL_LIB) + await this.enterLoadLib(LOAD_LIB) + await this.enterAuthLoadLib(AUTH_LOAD_LIB) + await this.enterAuthPluginLib(AUTH_PLUGIN_LIB) } } export default InstallationPage; diff --git a/playwright_test/Pages/launchConfig.page.ts b/playwright_test/Pages/launchConfig.page.ts index 1daf2d7a..88156db2 100644 --- a/playwright_test/Pages/launchConfig.page.ts +++ b/playwright_test/Pages/launchConfig.page.ts @@ -1,31 +1,38 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class LaunchConfigPage{ +class LaunchConfigPage { page: Page; + pageTitle: Locator; fillValidation: Locator; logLevel: Locator; fillLogLevel: Locator; readYaml: Locator; previous_step_button: Locator; - continue_ReviewSelector: Locator; + continueToReviewPage: Locator; editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - previous_step:Locator; - close_button:Locator; + skip_button: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + previous_step: Locator; + close_button: Locator; CONFPAGE_TITLE: Locator; continueToComponentInstallation: Locator; - - + click_launchConfig: Locator; + validation: Locator; + componentConfig: Locator; + fillConfigLaunchValue: Locator; + viewAndSubmitJob: Locator; + certificateTab_title: Locator; + errorMsg: Locator; constructor(page: Page) { this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.click_launchConfig = page.locator('//span[text()="Launch Config"]') this.validation = page.getByLabel('Validation'); this.logLevel = page.getByLabel('LogLevel'); @@ -41,153 +48,160 @@ class LaunchConfigPage{ 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.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') this.previous_step = page.locator('//button[contains(text(),"Previous step")]') this.skip_button = page.locator('//button[contains(text(),"Skip")]') this.close_button = page.locator('//button[contains(text(), "Close")]') this.certificateTab_title = page.locator('//div[text()="Certificates"]') - this.continue_ReviewSelector = page.locator('//button[contains(text(), "Review")]') + this.continueToReviewPage = page.locator('//button[contains(text(), "Review")]') this.errorMsg = page.locator('//p[text()="is a required property"]') } - async movetoLaunchConfigPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.continueToComponentInstallation.click({timeout: 5000}) - await this.click_launchConfig.click({timeout: 5000}) + commonPage = new CommonPage(); + + async getLaunchConfigurationPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); + } + + async movetoLaunchConfigPage() { + await this.licenseAgreement.click({ timeout: 9000 }) + await this.acceptLicense.click({ timeout: 9000 }) + await this.continueToComponentInstallation.click({ timeout: 5000 }) + await this.click_launchConfig.click({ timeout: 5000 }) + } + async returnTitleOfConfPage() { + const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); + return apfAuth_title; } - async returnTitleOfConfPage(){ - const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); - return apfAuth_title; + async fillvalues(validation: string) { + await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); } - async fillvalues(validation:string){ - await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); + async fillvalues_logLevel(logLevel: string) { + await this.fillLogLevel.fill(logLevel, { timeout: 10000 }) } - async fillvalues_logLevel(logLevel:string){ - await this.fillLogLevel.fill(logLevel,{ timeout: 10000 }) - } - async fillvaluescomponentConfig(componentConfig:string){ - await this.fillConfigLaunchValue.fill(componentConfig,{ timeout: 10000 }) + async fillvaluescomponentConfig(componentConfig: string) { + await this.fillConfigLaunchValue.fill(componentConfig, { timeout: 10000 }) } - async get_validation_value(){ - const inputLocator = await this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); - const value = await inputLocator.inputValue(); - console.log('Input field value:', value); - return value; + async get_validation_value() { + const inputLocator = await this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); + const value = await inputLocator.inputValue(); + console.log('Input field value:', value); + return value; } - async get_validation_error_msg(){ - const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); - console.log(errorText); - return errorText; + async get_validation_error_msg() { + const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); + console.log(errorText); + return errorText; } - async get_logLevel_value(){ - const value = await this.fillLogLevel.inputValue(); - console.log('Input field value:', value); - return value; + async get_logLevel_value() { + const value = await this.fillLogLevel.inputValue(); + console.log('Input field value:', value); + return value; } - async get_componentConfig_value(){ - const value = await this.fillConfigLaunchValue.inputValue(); - console.log('Input field value:', value); - return value; + async get_componentConfig_value() { + const value = await this.fillConfigLaunchValue.inputValue(); + console.log('Input field value:', value); + return value; } - async viewYaml(){ + async viewYaml() { await this.view_yaml.click({ timeout: 5000 }) } - async closeButton(){ - this.close_button.click({ timeout: 2000 }) + async closeButton() { + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob(){ - this.viewAndSubmitJob.click({ timeout: 2000 }) + async click_viewAndSubmitJob() { + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob(){ - this.view_job_output.click({ timeout: 2000 }) + async click_previewJob() { + this.view_job_output.click({ timeout: 2000 }) } - async is_skipLaunchConfigButtonEnable(){ - return await this.skip_button.isEnabled({ timeout: 5000 }); + async is_skipLaunchConfigButtonEnable() { + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipLaunhConfig(){ - await this.skip_button.click({ timeout: 2000 }); - const certificatePage_title = await this.certificateTab_title.textContent(); - return certificatePage_title; + async click_skipLaunhConfig() { + await this.skip_button.click({ timeout: 2000 }); + const certificatePage_title = await this.certificateTab_title.textContent(); + return certificatePage_title; } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable() { + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage(){ - await this.previous_step_button.click({ timeout: 2000 }); - const certificate_title = await this.certificateTab_title.textContent(); - return certificate_title; + async returnTitleOfPrevPage() { + await this.previous_step_button.click({ timeout: 2000 }); + const certificate_title = await this.certificateTab_title.textContent(); + return certificate_title; } - async open_monacoEditor(){ - this.view_yaml.click({ timeout: 5000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor() { + this.view_yaml.click({ timeout: 5000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable(){ - return await this.continue_ReviewSelector.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + return await this.continueToReviewPage.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose() { + this.save_and_close.click({ timeout: 2000 }) } async read_yaml() { let previousScrollHeight = 0; let allText = ''; while (true) { - // Extract text from all div.view-line elements - const newText = await this.page.evaluate(() => { - const viewLines = document.querySelectorAll('.view-lines .view-line'); - let text = ''; - viewLines.forEach((line) => { - text += line.textContent + '\n'; - }); - return text; - }); - - // Append the new text to the existing text - allText += newText; - console.log(allText) - - // Scroll a little to load more content - await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - editor.scrollTop += 100; // Adjust the scroll amount as needed - }); - - // Wait for a brief moment for new content to load - await this.page.waitForTimeout(1000); // Adjust timeout as needed - - // Get the current scroll height - const currentScrollHeight = await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - return editor.scrollHeight; + // Extract text from all div.view-line elements + const newText = await this.page.evaluate(() => { + const viewLines = document.querySelectorAll('.view-lines .view-line'); + let text = ''; + viewLines.forEach((line) => { + text += line.textContent + '\n'; }); - - // If the scroll height hasn't changed since the last iteration, we've reached the end - if (currentScrollHeight === previousScrollHeight) { - break; - } - - // Update the previous scroll height for the next iteration - previousScrollHeight = currentScrollHeight; + return text; + }); + + // Append the new text to the existing text + allText += newText; + console.log(allText) + + // Scroll a little to load more content + await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + editor.scrollTop += 100; // Adjust the scroll amount as needed + }); + + // Wait for a brief moment for new content to load + await this.page.waitForTimeout(1000); // Adjust timeout as needed + + // Get the current scroll height + const currentScrollHeight = await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + return editor.scrollHeight; + }); + + // If the scroll height hasn't changed since the last iteration, we've reached the end + if (currentScrollHeight === previousScrollHeight) { + break; + } + + // Update the previous scroll height for the next iteration + previousScrollHeight = currentScrollHeight; } console.log('All text:', allText); return allText; -} + } } - export default LaunchConfigPage; \ No newline at end of file +export default LaunchConfigPage; \ No newline at end of file diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 31757b92..bb499788 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -29,6 +29,7 @@ class PlanningPage{ continueInstallationOptions: Locator; readyToProceedMessage: Locator; errorMessage: Locator; + save_and_close: Locator; constructor(page: Page) { this.page = page; @@ -59,7 +60,7 @@ class PlanningPage{ this.continueInstallationOptions = page.locator("//button[contains(text(), 'Continue to Installation Options')]") this.readyToProceedMessage = page.locator("//div[contains(@class,'MuiBox-root css-hieomr')]/p") this.errorMessage = page.locator("//div[contains(@class,'MuiAlert-message')]") - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') } async clickZoweInstallationLink(){ @@ -210,7 +211,7 @@ class PlanningPage{ return false; } } - + async clickSaveAndClose(){ await this.saveAndClose.click({timeout: 15000}); @@ -223,7 +224,7 @@ class PlanningPage{ async clickContinueToInstallation(){ const timeout = 30000; - const interval = 100; + const interval = 100; const startTime = Date.now(); const isButtonEnabled = async (): Promise => { return await this.isContinueToInstallationEnabled(); @@ -257,21 +258,18 @@ class PlanningPage{ await this.saveAndValidate.click(); await this.page.waitForTimeout(500); } - - - async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, profileIdentifier:any, jobPrefix:any,jobname:any, javaLocation:any,nodejsLocation:any,zOSMFHost:any,zOSMFPort:any,zOSMFAppID:any){ + + + async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, javaLocation:any,nodejsLocation:any,zOSMFHost:any,zOSMFPort:any,zOSMFAppID:any){ await this.clickSaveValidate(); await this.enterRuntimeDir(runtimeDir); await this.enterWorkspaceDir(workspaceDir); await this.enterLogsDir(logDir); await this.enterExtensionsDir(extensionDir); - await this.enterRbacProfileIdentifier(profileIdentifier); - await this.enterJobName(jobname); - await this.enterJobPrefix(jobPrefix); await this.enterJavaLocation(javaLocation); await this.enterNodeJsLocation(nodejsLocation); - //await this.enterZosmfHost(zOSMFHost); - //await this.enterZosmfPort(zOSMFPort); + await this.enterZosmfHost(zOSMFHost); + await this.enterZosmfPort(zOSMFPort); await this.enterZosmfApplicationId(zOSMFAppID); await this.page.waitForTimeout(2000); } diff --git a/playwright_test/Pages/review.page.ts b/playwright_test/Pages/review.page.ts new file mode 100644 index 00000000..7ed00deb --- /dev/null +++ b/playwright_test/Pages/review.page.ts @@ -0,0 +1,190 @@ +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; + +class ReviewPage { + page: Page; + pageTitle: Locator; + reviewInstallationTab: Locator; + connectionTab: Locator; + planningTab: Locator; + installationTypeTab: Locator; + initializationTab: Locator; + installationTab: Locator; + networkingTab: Locator; + apfAuthTab: Locator; + securityTab: Locator; + stcsTab: Locator; + certificatesTab: Locator; + cachingServiceTab: Locator; + launchConfigTab: Locator; + connectionTabSuccessfulIcon: Locator; + planningTabSuccessfulIcon: Locator; + installationTypeTabSuccessfulIcon: Locator; + initializationTabPendingIcon: Locator; + installationTabPendingIcon: Locator; + networkingTabPendingIcon: Locator; + apfAuthTabPendingIcon: Locator; + securityTabPendingIcon: Locator; + certificatesTabPendingIcon: Locator; + launchConfigTabPendingIcon: Locator; + viewEditYaml: Locator; + viewJobOutput: Locator; + saveAndClose: Locator; + previousStep: Locator; + finishInstallation: Locator; + editorTitleElement: Locator; + closeEditorButton: Locator; + + constructor(page: Page) { + this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") + this.reviewInstallationTab = page.locator("//span[text()='Review Installation']") + this.connectionTab = page.locator("//p[text()='Connection']") + this.planningTab = page.locator("//p[text()='Planning']") + this.installationTypeTab = page.locator("//p[text()='Installation Type']") + this.initializationTab = page.locator("//p[text()='Initialization']") + this.installationTab = page.locator("//p[text()='Installation']") + this.networkingTab = page.locator("//p[text()='Networking']") + this.apfAuthTab = page.locator("//p[text()='APF Auth']") + this.securityTab = page.locator("//p[text()='Security']") + this.stcsTab = page.locator("//p[text()='Stcs']") + this.certificatesTab = page.locator("//p[text()='Certificates']") + this.cachingServiceTab = page.locator("//p[text()='Caching Service']") + this.launchConfigTab = page.locator("//p[text()='Launch Config']") + this.connectionTabSuccessfulIcon = page.locator("//p[text()='Connection']/following-sibling::*[@data-testid='CheckCircleIcon']") + this.planningTabSuccessfulIcon = page.locator("//p[text()='Planning']/following-sibling::*[@data-testid='CheckCircleIcon']") + this.installationTypeTabSuccessfulIcon = page.locator("//p[text()='Installation Type']/following-sibling::*[@data-testid='CheckCircleIcon']") + this.initializationTabPendingIcon = page.locator("//p[text()='Initialization']/following-sibling::*[@data-testid='WarningIcon']") + this.installationTabPendingIcon = page.locator("//p[text()='Installation']/following-sibling::*[@data-testid='WarningIcon']") + this.networkingTabPendingIcon = page.locator("//p[text()='Networking']/following-sibling::*[@data-testid='WarningIcon']") + this.apfAuthTabPendingIcon = page.locator("//p[text()='APF Auth']/following-sibling::*[@data-testid='WarningIcon']") + this.securityTabPendingIcon = page.locator("//p[text()='Security']/following-sibling::*[@data-testid='WarningIcon']") + this.certificatesTabPendingIcon = page.locator("//p[text()='Certificates']/following-sibling::*[@data-testid='WarningIcon']") + this.launchConfigTabPendingIcon = page.locator("//p[text()='Launch Config']/following-sibling::*[@data-testid='WarningIcon']") + this.viewEditYaml = page.locator("//button[text()='View Yaml']") + this.viewJobOutput = page.locator("//button[text()='View Job Output']") + this.saveAndClose = page.locator("//button[text()='Save & close']") + this.previousStep = page.locator("//button[text()='Previous step']") + this.finishInstallation = page.locator("//button[text()='Finish Installation']") + this.editorTitleElement = page.locator("//h2[text()='Editor']") + this.closeEditorButton = page.locator("//button[text()='Close']") + } + + commonPage = new CommonPage(); + + async getReviewPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); + } + + async clickReviewInstallationTab() { + await this.commonPage.waitForElement(this.reviewInstallationTab) + await this.reviewInstallationTab.click(); + } + + async clickConnectionTab() { + await this.commonPage.waitForElement(this.connectionTab) + await this.connectionTab.click(); + } + + async clickPlanningTab() { + await this.commonPage.waitForElement(this.planningTab) + await this.planningTab.click(); + } + + async clickInstallationTypeTab() { + await this.commonPage.waitForElement(this.installationTypeTab) + await this.installationTypeTab.click(); + } + + async clickInstallationTab() { + await this.commonPage.waitForElement(this.installationTab) + await this.installationTab.click(); + } + + async clickNetworkingTab() { + await this.commonPage.waitForElement(this.networkingTab) + await this.networkingTab.click(); + } + + async clickApfAuthTab() { + await this.commonPage.waitForElement(this.apfAuthTab) + await this.apfAuthTab.click(); + } + + async clickSecurityTab() { + await this.commonPage.waitForElement(this.securityTab) + await this.securityTab.click(); + } + + async clickStcsTab() { + await this.commonPage.waitForElement(this.stcsTab) + await this.stcsTab.click(); + } + + async clickCertificatesTab() { + await this.commonPage.waitForElement(this.certificatesTab) + await this.certificatesTab.click(); + } + + async clickCachingServiceTab() { + await this.commonPage.waitForElement(this.cachingServiceTab) + await this.cachingServiceTab.click(); + } + + async clickLaunchConfigTab() { + await this.commonPage.waitForElement(this.launchConfigTab) + await this.launchConfigTab.click(); + } + + async clickViewEditYaml() { + await this.commonPage.waitForElement(this.viewEditYaml) + await this.viewEditYaml.click(); + } + + async clickViewJobOutput() { + await this.commonPage.waitForElement(this.viewJobOutput) + await this.viewJobOutput.click(); + await this.page.waitForTimeout(2000); + } + + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); + } + + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) + await this.previousStep.click(); + } + + async clickFinishInstallation() { + await this.commonPage.waitForElement(this.finishInstallation) + await this.finishInstallation.click(); + } + + async isFinishInstallationDisabled() { + await this.commonPage.waitForElement(this.finishInstallation) + return await this.finishInstallation.isDisabled() + } + + async isFinishInstallationEnabled() { + await this.commonPage.waitForElement(this.finishInstallation) + return await this.finishInstallation.isEnabled() + } + + async open_monacoEditor() { + await this.commonPage.waitForElement(this.viewEditYaml) + this.viewEditYaml.click({ timeout: 2000 }) + await this.commonPage.waitForElement(this.editorTitleElement) + const editor_title = await this.editorTitleElement.textContent(); + return editor_title; + } + + async clickCloseEditor() { + await this.commonPage.waitForElement(this.closeEditorButton) + await this.closeEditorButton.click(); + } + +} +export default ReviewPage; diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index 89c4d20d..f65ed545 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -1,8 +1,9 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class SecurityPage{ +class SecurityPage { page: Page; + pageTitle: Locator; writeConfig_greenCheckXpath: Locator; uploadYaml_greenCheckXpath: Locator; init_security_greenCheckXpath: Locator; @@ -11,30 +12,34 @@ class SecurityPage{ editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - previous_step:Locator; - initSecurity:Locator; - close_button:Locator; - admin:Locator; - stc:Locator; - sys_prog:Locator; - user_zis:Locator; - user_zowe:Locator; - aux:Locator; - stc_zowe:Locator; - stc_zis:Locator; + skip_button: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + previous_step: Locator; + initSecurity: Locator; + close_button: Locator; + admin: Locator; + stc: Locator; + sys_prog: Locator; + user_zis: Locator; + user_zowe: Locator; + aux: Locator; + stc_zowe: Locator; + stc_zis: Locator; product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; - - + certificateTab_title: Locator; + mainXpath: string; + stc_mainXpath: string; + viewAndSubmitJob: Locator; + securityTab_title: Locator; constructor(page: Page) { this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.writeConfig_greenCheckXpath = page.locator('#card-init-security-progress-card svg.MuiSvgIcon-colorSuccess') this.uploadYaml_greenCheckXpath = page.locator('#card-download-progress-card svg.MuiSvgIcon-colorSuccess') this.init_security_greenCheckXpath = page.locator("#card-success-progress-card svg.MuiSvgIcon-colorSuccess") @@ -47,160 +52,165 @@ class SecurityPage{ this.mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[3]/div/div[2]/div/div/div' this.stc_mainXpath = '//html/body/div[1]/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[4]/div/div[2]/div/div/div/' this.product = page.locator('input[role="combobox"]') - this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') this.previous_step = page.locator('//button[contains(text(),"Previous step")]') this.skip_button = page.locator('//button[contains(text(),"Skip ")]') this.initSecurity = page.locator("//button[contains(text(), 'Initialize Security Config')]") this.close_button = page.locator('//button[contains(text(), "Close")]') this.certificateTab_title = page.locator('//div[text()="Certificates"]') - this.stc_title = page.locator('//div[text()="Stcs"]') this.securityTab_title = page.locator('//div[text()="Security"]') this.continue_CertificateSelector = page.locator('//button[contains(text(), "Continue to STC Setup")]') - this.admin = page.getByLabel('Admin'); - this.stc = page.getByLabel('Stc'); - this.sys_prog = page.getByLabel('Sys Prog'); - this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/div/input'); - this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/div/input'); - this.aux = page.getByLabel('Aux'); - this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); - this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); + this.stc = page.getByLabel('Stc'); + this.sys_prog = page.getByLabel('Sys Prog'); + this.user_zis = page.locator(this.mainXpath + '/div/div/div[2]/div/div/input'); + this.user_zowe = page.locator(this.mainXpath + '/div/div/div[1]/div/div/input'); + this.aux = page.getByLabel('Aux'); + this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); + this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); } - async movetoSecurityPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.continueToComponentInstallation.click({timeout: 5000}) - await this.skip_button.click() - await this.skip_button.click() + commonPage = new CommonPage(); + + async getSecurityPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); } - async fillProduct(product:string){ - await this.product.fill(product,{ timeout: 10000 }) + + async movetoSecurityPage() { + await this.licenseAgreement.click({ timeout: 9000 }) + await this.acceptLicense.click({ timeout: 9000 }) + await this.continueToComponentInstallation.click({ timeout: 5000 }) + await this.skip_button.click() + await this.skip_button.click() + } + async fillProduct(product: string) { + await this.product.fill(product, { timeout: 10000 }) } - async fillSecurityDetails(product:string, admin:string,stc:string,sys_prog:string,user_zis:string,user_zowe:string,aux: string, stc_zowe: string, stc_zis:string){ - await this.product.fill(product,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.admin.fill(admin,{ timeout: 10000 }) - await this.stc.fill(stc,{ timeout: 10000 }) - await this.sys_prog.fill(sys_prog,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.user_zis.fill(user_zis,{ timeout: 10000 }) - await this.user_zowe.fill(user_zowe,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.aux.fill(aux,{ timeout: 10000 }) - await this.stc_zowe.fill(stc_zowe,{ timeout: 10000 }) - await this.stc_zis.fill(stc_zis,{ timeout: 10000 }) + async fillSecurityDetails(product: string, admin: string, stc: string, sys_prog: string, user_zis: string, user_zowe: string, aux: string, stc_zowe: string, stc_zis: string) { + await this.product.fill(product, { timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.admin.fill(admin, { timeout: 10000 }) + await this.stc.fill(stc, { timeout: 10000 }) + await this.sys_prog.fill(sys_prog, { timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.user_zis.fill(user_zis, { timeout: 10000 }) + await this.user_zowe.fill(user_zowe, { timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.aux.fill(aux, { timeout: 10000 }) + await this.stc_zowe.fill(stc_zowe, { timeout: 10000 }) + await this.stc_zis.fill(stc_zis, { timeout: 10000 }) } - async fillAdmin(admin:string){ - await this.admin.fill(admin,{ timeout: 10000 }) + async fillAdmin(admin: string) { + await this.admin.fill(admin, { timeout: 10000 }) } - async initializeSecurity(){ - await this.initSecurity.click() + async initializeSecurity() { + await this.initSecurity.click() } - async isWriteConfigGreenCheckVisible(){ - return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); + async isWriteConfigGreenCheckVisible() { + return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isUploadConfigGreenCheckVisible(){ - await this.uploadYaml_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); + async isUploadConfigGreenCheckVisible() { + await this.uploadYaml_greenCheckXpath.waitFor({ timeout: 50000 }); + return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isInitSecurityGreenCheckVisible(){ - await this.init_security_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); + async isInitSecurityGreenCheckVisible() { + await this.init_security_greenCheckXpath.waitFor({ timeout: 50000 }); + return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable() { + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage(){ - await this.previous_step_button.click({ timeout: 2000 }); - const apfAuth_title = await this.APFAUTH_TITLE.textContent(); - return apfAuth_title; + async returnTitleOfPrevPage() { + await this.previous_step_button.click({ timeout: 2000 }); + const apfAuth_title = await this.APFAUTH_TITLE.textContent(); + return apfAuth_title; } - async viewYaml(){ + async viewYaml() { await this.view_yaml.click({ timeout: 2000 }) } - async closeButton(){ - this.close_button.click({ timeout: 2000 }) + async closeButton() { + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob(){ - this.viewAndSubmitJob.click({ timeout: 2000 }) + async click_viewAndSubmitJob() { + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob(){ - this.view_job_output.click({ timeout: 2000 }) + async click_previewJob() { + this.view_job_output.click({ timeout: 2000 }) } - async is_skipSecurityButtonEnable(){ - return await this.skip_button.isEnabled({ timeout: 5000 }); + async is_skipSecurityButtonEnable() { + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipSecurity(){ - await this.skip_button.click({ timeout: 2000 }); + async click_skipSecurity() { + await this.skip_button.click({ timeout: 2000 }); } - async open_monacoEditor(){ - this.view_yaml.click({ timeout: 2000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor() { + this.view_yaml.click({ timeout: 2000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable(){ - return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose() { + this.save_and_close.click({ timeout: 2000 }) } - async get_admin_value(){ - const admin_value = await this.admin.textContent(); - return admin_value; + async get_admin_value() { + const admin_value = await this.admin.textContent(); + return admin_value; } - async get_stc_value(){ - const stc_value = await this.stc.textContent(); - return stc_value; + async get_stc_value() { + const stc_value = await this.stc.textContent(); + return stc_value; } - async get_user_zowe_value(){ - const userZowe_value = await this.user_zowe.textContent(); - return userZowe_value; + async get_user_zowe_value() { + const userZowe_value = await this.user_zowe.textContent(); + return userZowe_value; } - async get_user_zis_value(){ - const userZis_value = await this.user_zis.textContent(); - return userZis_value; + async get_user_zis_value() { + const userZis_value = await this.user_zis.textContent(); + return userZis_value; } - async get_aux_value(){ - const aux_value = await this.aux.textContent(); - return aux_value; + async get_aux_value() { + const aux_value = await this.aux.textContent(); + return aux_value; } - async get_stc_zis_value(){ - const stcZis_value = await this.stc_zis.textContent(); - return stcZis_value; + async get_stc_zis_value() { + const stcZis_value = await this.stc_zis.textContent(); + return stcZis_value; } - async get_stc_zowe_value(){ - const stcZowe_value = await this.stc_zowe.textContent(); - return stcZowe_value; + async get_stc_zowe_value() { + const stcZowe_value = await this.stc_zowe.textContent(); + return stcZowe_value; } - async get_sysProg_value(){ - const sysProg_value = await this.sys_prog.textContent(); - return sysProg_value; + async get_sysProg_value() { + const sysProg_value = await this.sys_prog.textContent(); + return sysProg_value; } - async returnTitleOfSecurityPage(){ - const securityPage_title = await this.securityTab_title.textContent(); - return securityPage_title; + async returnTitleOfSecurityPage() { + const securityPage_title = await this.securityTab_title.textContent(); + return securityPage_title; } - async returnTitleOfCertPage(){ + async returnTitleOfCertPage() { const certPage_title = await this.certificateTab_title.textContent(); return certPage_title; } - - async returnTitleOfstcPage(){ - const stcPage_title = await this.stc_title.textContent(); - return stcPage_title; + + async returnTitleOfstcPage() { + const stcPage_title = await this.stc_title.textContent(); + return stcPage_title; } } diff --git a/playwright_test/Pages/title.page.ts b/playwright_test/Pages/title.page.ts index 0cb0a10a..a927b3f9 100644 --- a/playwright_test/Pages/title.page.ts +++ b/playwright_test/Pages/title.page.ts @@ -1,4 +1,5 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; class TitlePage { page: Page; @@ -13,14 +14,16 @@ class TitlePage { this.resumeProgressButton = page.locator("//button[text()='Resume Progress']") } - async navigateToConnectionTab(){ - await this.zoweInstallButton.click({timeout: 9000}) - } - - async clickOnResumeProgress(){ - await this.resumeProgressButton.click({timeout: 3000}) + commonPage = new CommonPage(); + + async navigateToConnectionTab() { + await this.commonPage.waitForElement(this.zoweInstallButton) + await this.zoweInstallButton.click({ timeout: 9000 }) } + async clickOnResumeProgress() { + await this.commonPage.waitForElement(this.resumeProgressButton) + await this.resumeProgressButton.click({ timeout: 3000 }) + } } - - export default TitlePage; \ No newline at end of file +export default TitlePage; \ No newline at end of file diff --git a/playwright_test/Tests/ApfAuth.spec.ts b/playwright_test/Tests/ApfAuth.spec.ts index 5d4b797d..d0229299 100644 --- a/playwright_test/Tests/ApfAuth.spec.ts +++ b/playwright_test/Tests/ApfAuth.spec.ts @@ -1,4 +1,4 @@ -import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; +import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; import { prepareEnvironment } from '../prepare.js'; import ApfAuthPage from '../Pages/ApfAuth.page'; import TitlePage from '../Pages/title.page'; @@ -8,203 +8,196 @@ import InstallationTypePage from '../Pages/installationType.page'; import InstallationPage from '../Pages/installation.page.ts'; import NetworkingPage from '../Pages/networking.page'; import config from '../utils/config'; -import { spawn } from 'child_process'; -import path from 'path'; let page: Page; - let electronApp: ElectronApplication -const APF_AUTH_TITLE ='APF Authorize Load Libraries' +const APF_AUTH_TITLE = 'APF Authorize Load Libraries' const NETWORKING_TITLE = 'Networking' const INSTALLATION_TITLE = 'Installation' const SECURITY_TITLE = 'Security' - test.beforeAll(async () => { try { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); - test.describe('ApfAuthTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let apfAuthPage : ApfAuthPage; - let planningPage : PlanningPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page = await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page) - apfAuthPage = new ApfAuthPage(page); - installationTypePage = new InstallationTypePage(page); - installationPage = new InstallationPage(page); - networkingPage = new NetworkingPage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillAllFields(config.DATASET_PREFIX, - config.PARM_LIB, - config.PROC_LIB, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - await networkingPage.click_skipNetworking() - await page.waitForTimeout(1000); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - test('Test Resume Progress', async ({ page }) => { - apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) - apfAuthPage.click_saveAndClose() - connectionPage.click_resumeProgress() - const title = await apfAuthPage.returnTitleOfApfAuthPage(); - expect(title).toBe(config.APF_AUTH_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); - const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); - expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); - expect(AuthLoadLib_Value).toBe(config.AUTH_LOAD_LIB); - expect(AuthPluginLib_Value).toBe(config.AUTH_PLUGIN_LIB); - }) - - test('Verify title', async ({ page }) => { - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - await expect(apfAuthPage.datasetPrefix).toBeTruthy() - await expect(apfAuthPage.authLoadLib).toBeTruthy() - await expect(apfAuthPage.authpluginLib).toBeTruthy() - await expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() - await expect(apfAuthPage.view_yaml).toBeTruthy() - await expect(apfAuthPage.save_and_close).toBeTruthy() - await expect(apfAuthPage.previous_step).toBeTruthy() - await expect(apfAuthPage.skip_apf_auth).toBeTruthy() - await expect(apfAuthPage.continue_security_setup).toBeTruthy() - - }) - test('test apfAuth with empty data', async ({ page }) => { - apfAuthPage.fillApfDetails('','','') - apfAuthPage.movetoApfAuthPage() - apfAuthPage.initializeApfauth() - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(false); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(false); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(false); - }) - test('test apfAuth with valid data', async ({ page }) => { - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - apfAuthPage.initializeApfauth() - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(true); - }) - - test('click Previous step', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const title = await apfAuthPage.returnTitleOfPrevPage(); - expect(title).toBe(NETWORKING_TITLE); - }) - - test('test skip apfAuth button is enable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); - expect(isSkipApfAuthEnable).toBe(true); - }) - - test('test previous button is enabled', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - }) - - test('test continue button is disable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) - - test('click view yaml button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.viewYaml() - await expect(apfAuthPage.editor_title_element).toBeTruthy(); - apfAuthPage.closeButton() - }) - - test('test click skip APFAuth button', async ({ page }) => { - await apfAuthPage.movetoApfAuthPage() - const security_title = await apfAuthPage.click_skipApfAuth(); - expect(security_title).toBe(SECURITY_TITLE); - - }) - - test('Test view and submit button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_viewAndSubmitJob() - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - }) - - - test('Test view job', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_previewJob() - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_saveAndClose() - titlePage.clickOnResumeProgress(); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); - const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); - expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); - expect(authLoadLibValue).toBe(config.AUTH_LOAD_LIB); - expect(authPluginLibValue).toBe(config.AUTH_PLUGIN_LIB); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let apfAuthPage: ApfAuthPage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage; + let installationPage: InstallationPage; + let networkingPage: NetworkingPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page) + apfAuthPage = new ApfAuthPage(page); + installationTypePage = new InstallationTypePage(page); + installationPage = new InstallationPage(page); + networkingPage = new NetworkingPage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, + config.PROC_LIB, + config.PARM_LIB, + config.ZIS, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + await networkingPage.click_skipNetworking() + await page.waitForTimeout(1000); + }) + + test.afterEach(async () => { + await electronApp.close() + }) + test('Test Resume Progress', async ({ page }) => { + apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) + apfAuthPage.click_saveAndClose() + connectionPage.click_resumeProgress() + const title = await apfAuthPage.returnTitleOfApfAuthPage(); + expect(title).toBe(config.APF_AUTH_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); + const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); + expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); + expect(AuthLoadLib_Value).toBe(config.AUTH_LOAD_LIB); + expect(AuthPluginLib_Value).toBe(config.AUTH_PLUGIN_LIB); + }) + + test('Verify title', async ({ page }) => { + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + await expect(apfAuthPage.datasetPrefix).toBeTruthy() + await expect(apfAuthPage.authLoadLib).toBeTruthy() + await expect(apfAuthPage.authpluginLib).toBeTruthy() + await expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() + await expect(apfAuthPage.view_yaml).toBeTruthy() + await expect(apfAuthPage.save_and_close).toBeTruthy() + await expect(apfAuthPage.previous_step).toBeTruthy() + await expect(apfAuthPage.skip_apf_auth).toBeTruthy() + await expect(apfAuthPage.continue_security_setup).toBeTruthy() + + }) + test('test apfAuth with empty data', async ({ page }) => { + apfAuthPage.fillApfDetails('', '', '') + apfAuthPage.movetoApfAuthPage() + apfAuthPage.initializeApfauth() + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(false); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); + expect(isUploadConfig_check_visible).toBe(false); + const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); + expect(isInitApf_check_visible).toBe(false); + }) + test('test apfAuth with valid data', async ({ page }) => { + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + apfAuthPage.initializeApfauth() + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); + expect(isInitApf_check_visible).toBe(true); + }) + + test('click Previous step', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const title = await apfAuthPage.returnTitleOfPrevPage(); + expect(title).toBe(NETWORKING_TITLE); + }) + + test('test skip apfAuth button is enable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); + expect(isSkipApfAuthEnable).toBe(true); + }) + + test('test previous button is enabled', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + }) + + test('test continue button is disable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) + + test('click view yaml button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.viewYaml() + await expect(apfAuthPage.editor_title_element).toBeTruthy(); + apfAuthPage.closeButton() + }) + + test('test click skip APFAuth button', async ({ page }) => { + await apfAuthPage.movetoApfAuthPage() + const security_title = await apfAuthPage.click_skipApfAuth(); + expect(security_title).toBe(SECURITY_TITLE); + + }) + + test('Test view and submit button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_viewAndSubmitJob() + await expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + }) + + + test('Test view job', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_previewJob() + await expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_saveAndClose() + titlePage.clickOnResumeProgress(); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); + const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); + expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); + expect(authLoadLibValue).toBe(config.AUTH_LOAD_LIB); + expect(authPluginLibValue).toBe(config.AUTH_PLUGIN_LIB); + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/Installation.spec.ts b/playwright_test/Tests/Installation.spec.ts index 5fa352eb..2f2655fc 100644 --- a/playwright_test/Tests/Installation.spec.ts +++ b/playwright_test/Tests/Installation.spec.ts @@ -16,11 +16,11 @@ const DOWNLOAD_ZOWE_TITLE = 'Download Zowe Pax'; test.describe('InstallationTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage + let titlePage: TitlePage; + let installationTypePage: InstallationTypePage; + let planningPage: PlanningPage; + let installationPage: InstallationPage; + let networkingPage: NetworkingPage test.beforeEach(async ({ page }) => { @@ -33,29 +33,26 @@ test.describe('InstallationTab', () => { installationTypePage = new InstallationTypePage(page); installationPage = new InstallationPage(page); networkingPage = new NetworkingPage(page); - + titlePage.navigateToConnectionTab() await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); await planningPage.clickValidateLocations() await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() + await installationTypePage.skipUnpax() }) test.afterEach(async () => { @@ -81,23 +78,24 @@ test.describe('InstallationTab', () => { expect(installationPage.clickContinueToNetworkSetup).toBeTruthy() const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_disable).toBe(true); - }) + }) test('Test Installation with Valid Data with Download Pax', async ({ page }) => { - await installationPage.fillAllFields(config.DATASET_PREFIX, - config.PARM_LIB, - config.PROC_LIB, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) + await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, + config.PROC_LIB, + config.PARM_LIB, + config.ZIS, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) await installationPage.clickInstallMvsDatasets(); const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_enable).toBe(true); await installationPage.clickContinueToNetworkSetup(); const networkconfig_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkconfig_title).toBe(NETWORKING_PAGE_TITLE); + expect(networkconfig_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with the Invalid Data', async ({ page }) => { @@ -109,7 +107,7 @@ test.describe('InstallationTab', () => { await installationPage.enterAuthLoadLib('AuthLoad') await installationPage.enterAuthPluginLib('') await installationPage.clickInstallMvsDatasetsInvalid(); - await installationPage.clickCloseEditor(); + await installationPage.clickCloseEditor(); const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_enable).toBe(false); }) @@ -123,9 +121,9 @@ test.describe('InstallationTab', () => { test('Test Skip Installation Button', async ({ page }) => { const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_disable).toBe(false); - const is_Skip_Button_disable = await installationPage.isSkipToNetworkSetupEnabled(); + const is_Skip_Button_disable = await installationPage.isSkipToNetworkSetupEnabled(); expect(is_Skip_Button_disable).toBe(false); - const title = await installationTypePage.getInstallationTypePageTitle(); + const title = await installationTypePage.getInstallationTypePageTitle(); expect(title).toBe(INSTALLATION_TYPE_TITLE); }) @@ -141,18 +139,19 @@ test.describe('InstallationTab', () => { await installationPage.clickCloseEditor() }) - test('Test Save and Close and Resume Progress', async ({page}) => { - await installationPage.fillAllFields(config.DATASET_PREFIX, - config.PARM_LIB, - config.PROC_LIB, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) + test('Test Save and Close and Resume Progress', async ({ page }) => { + await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, + config.PROC_LIB, + config.PARM_LIB, + config.ZIS, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) await installationPage.clickSaveAndClose(); await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); const prefix_value = await installationPage.getPrefixValue(); const procLib_value = await installationPage.getProclibValue(); @@ -164,5 +163,5 @@ test.describe('InstallationTab', () => { expect(procLib_value).toBe(config.PROC_LIB); expect(authLoadLib_value).toBe(config.AUTH_LOAD_LIB); expect(authPluginLib_value).toBe(config.AUTH_PLUGIN_LIB); - }) + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/Networking.spec.ts b/playwright_test/Tests/Networking.spec.ts index 55202448..b2416a37 100644 --- a/playwright_test/Tests/Networking.spec.ts +++ b/playwright_test/Tests/Networking.spec.ts @@ -24,72 +24,70 @@ test.beforeAll(async () => { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); test.describe('networkingTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let securityPage : SecurityPage; - let planningPage : PlanningPage; - let networkingPage : NetworkingPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page = await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - networkingPage = new NetworkingPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - installationPage = new InstallationPage(page); - installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillAllFields(config.DATASET_PREFIX, - config.PARM_LIB, - config.PROC_LIB, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - }) - - test.afterEach(async () => { - await electronApp.close() - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let securityPage: SecurityPage; + let planningPage: PlanningPage; + let networkingPage: NetworkingPage; + let installationTypePage: InstallationTypePage; + let installationPage: InstallationPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + networkingPage = new NetworkingPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + installationPage = new InstallationPage(page); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, + config.PROC_LIB, + config.PARM_LIB, + config.ZIS, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + }) + + test.afterEach(async () => { + await electronApp.close() + }) test('test title of page', async ({ page }) => { - const title = await networkingPage.returnTitleOfNetworkingPage(); - expect(title).toBe(NETWORKING_TITLE); - }) - + const title = await networkingPage.returnTitleOfNetworkingPage(); + expect(title).toBe(NETWORKING_TITLE); + }) + test('test all required fields', async ({ page }) => { await expect(networkingPage.externalDomains).toBeTruthy() await expect(networkingPage.externalPort).toBeTruthy() @@ -108,7 +106,7 @@ test.describe('networkingTab', () => { await expect(networkingPage.appServer).toBeTruthy() await expect(networkingPage.cachingService).toBeTruthy() await expect(networkingPage.discovery).toBeTruthy() - }) + }) test('test external domain field', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); @@ -128,7 +126,7 @@ test.describe('networkingTab', () => { await networkingPage.add_DomainNameField(); await expect(networkingPage.domainName).toBeTruthy() }) - + test('test add special char in other port no', async ({ page }) => { const originalValue = await networkingPage.get_metricServiceport_value(); await networkingPage.fillMetricServicePort('*^%$^&'); @@ -138,49 +136,49 @@ test.describe('networkingTab', () => { test('test enabled metric service debug', async ({ page }) => { const beforeClick = await networkingPage.isMetricsServiceDebugChecked(); - expect(beforeClick).toBe(false); - await networkingPage.clickMetricsServiceDebug(); - const afterClick = await networkingPage.isMetricsServiceDebugChecked(); - expect(afterClick).toBe(true); + expect(beforeClick).toBe(false); + await networkingPage.clickMetricsServiceDebug(); + const afterClick = await networkingPage.isMetricsServiceDebugChecked(); + expect(afterClick).toBe(true); }) test('Test view yaml button', async ({ page }) => { await networkingPage.viewYaml() await expect(networkingPage.editor_title_element).toBeTruthy(); await networkingPage.closeButton() - }) + }) test('Test save and close', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); await networkingPage.click_saveAndClose() await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); const title = await networkingPage.returnTitleOfNetworkingPage(); expect(title).toBe(NETWORKING_TITLE); const port = await networkingPage.get_externalDomainport_value(); const domainName = await networkingPage.get_externalDomainName_value(); expect(port).toBe(config.EXTERNAL_PORT); expect(domainName).toBe(config.DOMAIN_NAME); - }) + }) test('click Previous step button', async ({ page }) => { - const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - const title = await networkingPage.returnTitleOfPrevPage(); - expect(title).toBe(INSTALLATION_TITLE); - }) + const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + const title = await networkingPage.returnTitleOfPrevPage(); + expect(title).toBe(INSTALLATION_TITLE); + }) test('Test continue to APF Auth button is disable', async ({ page }) => { - const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) - + const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) + test('Test Skip networking button is enable', async ({ page }) => { - const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); - expect(isLaunchConfigEnable).toBe(true); - }) + const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); + expect(isLaunchConfigEnable).toBe(true); + }) test('Test yaml should be updated', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); @@ -189,5 +187,5 @@ test.describe('networkingTab', () => { const yaml = await networkingPage.read_yaml(); expect(yaml).toContain(config.DOMAIN_NAME); expect(yaml).toContain(config.EXTERNAL_PORT); - }) + }) }); diff --git a/playwright_test/Tests/Review.spec.ts b/playwright_test/Tests/Review.spec.ts new file mode 100644 index 00000000..65587dc9 --- /dev/null +++ b/playwright_test/Tests/Review.spec.ts @@ -0,0 +1,239 @@ +import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; +import TitlePage from '../Pages/title.page.ts'; +import ConnectionPage from '../Pages/connection.page.ts'; +import PlanningPage from '../Pages/planning.page.ts'; +import InstallationTypePage from '../Pages/installationType.page.ts'; +import InstallationPage from '../Pages/installation.page.ts'; +import NetworkingPage from '../Pages/networking.page.ts'; +import ApfAuthPage from '../Pages/ApfAuth.page.ts'; +import SecurityPage from '../Pages/security.page.ts'; +import CertificatesPage from '../Pages/certificates.page.ts'; +import LaunchConfigPage from '../Pages/launchConfig.page'; +import ReviewPage from '../Pages/review.page.ts'; +import config from '../utils/config.ts'; +import { prepareEnvironment } from '../prepare.js'; + +let electronApp: ElectronApplication +const CONNECTION_PAGE_TITLE = 'Connection'; +const PLANNING_PAGE_TITLE = 'Before you start'; +const INSTALLATION_TYPE_PAGE_TITLE = 'Installation Type'; +const INSTALLATION_PAGE_TITLE = 'Installation'; +const NETWORKING_PAGE_TITLE = 'Networking'; +const APF_AUTH_PAGE_TITLE = 'APF Authorize Load Libraries'; +const SECURITY_PAGE_TITLE = 'Security'; +const STCS_PAGE_TITLE = 'Stcs'; +const CERTIFICATES_PAGE_TITLE = 'Certificates'; +const CACHING_SERVICE_PAGE_TITLE = 'CachingService'; +const LAUNCH_CONFIGURATION_PAGE_TITLE = 'Configuration'; +const REVIEW_PAGE_TITLE = 'Review Installation'; + +test.describe('ReviewTab', () => { + let titlePage: TitlePage; + let connectionPage: ConnectionPage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage; + let installationPage: InstallationPage; + let networkingPage: NetworkingPage + let apfAuthPage: ApfAuthPage + let securityPage: SecurityPage + let certificatesPage: CertificatesPage; + let launchConfigPage: LaunchConfigPage; + let reviewPage: ReviewPage; + + test.beforeAll(async () => { + try { + await prepareEnvironment({ install: true, remove: false }); + } catch (error) { + console.error('Error during environment preparation:', error); + process.exit(1); + } + }); + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + titlePage = new TitlePage(page); + connectionPage = new ConnectionPage(page); + planningPage = new PlanningPage(page); + installationTypePage = new InstallationTypePage(page); + installationPage = new InstallationPage(page); + networkingPage = new NetworkingPage(page); + apfAuthPage = new ApfAuthPage(page); + securityPage = new SecurityPage(page); + certificatesPage = new CertificatesPage(page); + launchConfigPage = new LaunchConfigPage(page); + reviewPage = new ReviewPage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await page.waitForTimeout(5000); + reviewPage.clickReviewInstallationTab(); + await page.waitForTimeout(5000); + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test Title and all required fields on the Review page', async ({ page }) => { + const review_title = await reviewPage.getReviewPageTitle(); + expect(review_title).toBe(REVIEW_PAGE_TITLE); + expect(reviewPage.connectionTab).toBeTruthy() + expect(reviewPage.planningTab).toBeTruthy() + expect(reviewPage.installationTypeTab).toBeTruthy() + expect(reviewPage.installationTab).toBeTruthy() + expect(reviewPage.networkingTab).toBeTruthy() + expect(reviewPage.apfAuthTab).toBeTruthy() + expect(reviewPage.securityTab).toBeTruthy() + expect(reviewPage.certificatesTab).toBeTruthy() + expect(reviewPage.launchConfigTab).toBeTruthy() + expect(reviewPage.viewEditYaml).toBeTruthy() + expect(reviewPage.viewJobOutput).toBeTruthy() + expect(reviewPage.saveAndClose).toBeTruthy() + expect(reviewPage.previousStep).toBeTruthy() + const is_Finish_Button_disable = await reviewPage.isFinishInstallationDisabled(); + expect(is_Finish_Button_disable).toBe(true); + }) + + test('Test Navigation to Connection page', async ({ page }) => { + reviewPage.clickConnectionTab(); + await page.waitForTimeout(1000); + const connection_title = await connectionPage.getConnectionPageTitle(); + expect(connection_title).toBe(CONNECTION_PAGE_TITLE); + }) + + test('Test Navigation to Planning page', async ({ page }) => { + reviewPage.clickPlanningTab(); + await page.waitForTimeout(1000); + const planning_title = await planningPage.getPlanningPageTitle(); + expect(planning_title).toBe(PLANNING_PAGE_TITLE); + }) + + test('Test Navigation to Installation Type page', async ({ page }) => { + reviewPage.clickInstallationTypeTab(); + await page.waitForTimeout(1000); + const installation_type_title = await installationTypePage.getInstallationTypePageTitle(); + expect(installation_type_title).toBe(INSTALLATION_TYPE_PAGE_TITLE); + }) + + test('Test Navigation to Installation page', async ({ page }) => { + reviewPage.clickInstallationTab(); + await page.waitForTimeout(1000); + const installation_title = await installationPage.getInstallationPageTitle(); + expect(installation_title).toBe(INSTALLATION_PAGE_TITLE); + }) + + test('Test Navigation to Networking page', async ({ page }) => { + reviewPage.clickNetworkingTab(); + await page.waitForTimeout(1000); + const networking_title = await networkingPage.returnTitleOfNetworkingPage(); + expect(networking_title).toBe(NETWORKING_PAGE_TITLE); + }) + + test('Test Navigation to Apf Auth page', async ({ page }) => { + reviewPage.clickApfAuthTab(); + await page.waitForTimeout(1000); + const apfAuth_title = await apfAuthPage.getApfAuthPageTitle(); + expect(apfAuth_title).toBe(APF_AUTH_PAGE_TITLE); + }) + + test('Test Navigation to Security page', async ({ page }) => { + reviewPage.clickSecurityTab(); + await page.waitForTimeout(1000); + const security_title = await securityPage.getSecurityPageTitle(); + expect(security_title).toBe(SECURITY_PAGE_TITLE); + }) + + test('Test Navigation to Stcs page', async ({ page }) => { + reviewPage.clickStcsTab(); + await page.waitForTimeout(1000); + const stcs_title = await securityPage.getSecurityPageTitle(); + expect(stcs_title).toBe(STCS_PAGE_TITLE); + }) + + test('Test Navigation to Certificates page', async ({ page }) => { + reviewPage.clickCertificatesTab(); + await page.waitForTimeout(1000); + const certificates_title = await certificatesPage.getCertificatesPageTitle(); + expect(certificates_title).toBe(CERTIFICATES_PAGE_TITLE); + }) + + test('Test Navigation to Caching Service page', async ({ page }) => { + reviewPage.clickCachingServiceTab(); + await page.waitForTimeout(1000); + const cachingService_title = await securityPage.getSecurityPageTitle(); + expect(cachingService_title).toBe(CACHING_SERVICE_PAGE_TITLE); + }) + + test('Test Navigation to Launch Config page', async ({ page }) => { + reviewPage.clickLaunchConfigTab(); + await page.waitForTimeout(1000); + const launchConfig_title = await launchConfigPage.getLaunchConfigurationPageTitle(); + expect(launchConfig_title).toBe(LAUNCH_CONFIGURATION_PAGE_TITLE); + }) + + test('Test Successful and Pending Operations Tabs', async ({ page }) => { + expect(reviewPage.connectionTabSuccessfulIcon).toBeTruthy() + expect(reviewPage.planningTabSuccessfulIcon).toBeTruthy() + expect(reviewPage.installationTypeTabSuccessfulIcon).toBeTruthy() + expect(reviewPage.installationTabPendingIcon).toBeTruthy() + expect(reviewPage.networkingTabPendingIcon).toBeTruthy() + expect(reviewPage.apfAuthTabPendingIcon).toBeTruthy() + expect(reviewPage.securityTabPendingIcon).toBeTruthy() + expect(reviewPage.certificatesTabPendingIcon).toBeTruthy() + expect(reviewPage.launchConfigTabPendingIcon).toBeTruthy() + }) + + test('Test Finish Installation and Test Previous step', async ({ page }) => { + const is_Finish_Button_enable = await reviewPage.isFinishInstallationEnabled(); + expect(is_Finish_Button_enable).toBe(false); + reviewPage.clickPreviousStep(); + await page.waitForTimeout(2000); + const title = await launchConfigPage.getLaunchConfigurationPageTitle(); + expect(title).toBe(INSTALLATION_PAGE_TITLE); + }) + + test('Test View Yaml Button', async ({ page }) => { + reviewPage.clickViewEditYaml() + await page.waitForTimeout(2000); + expect(reviewPage.editorTitleElement).toBeTruthy(); + reviewPage.clickCloseEditor() + await page.waitForTimeout(2000); + }) + + test('Test View Job Output', async ({ page }) => { + reviewPage.clickViewJobOutput() + await page.waitForTimeout(2000); + expect(reviewPage.editorTitleElement).toBeTruthy(); + reviewPage.clickCloseEditor() + await page.waitForTimeout(2000); + }) + + test('Test Save and Close and Resume Progress', async ({ page }) => { + reviewPage.clickSaveAndClose(); + await page.waitForTimeout(2000); + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await connectionPage.SubmitValidateCredential(); + await page.waitForTimeout(5000); + const title = await reviewPage.getReviewPageTitle(); + expect(title).toBe(REVIEW_PAGE_TITLE); + }) +}) diff --git a/playwright_test/Tests/Security.spec.ts b/playwright_test/Tests/Security.spec.ts index 3a296d04..21a60a4c 100644 --- a/playwright_test/Tests/Security.spec.ts +++ b/playwright_test/Tests/Security.spec.ts @@ -16,7 +16,7 @@ let page: Page; let electronApp: ElectronApplication const CERTIFICATE_TITLE = 'Certificates' const SECURITY_TITLE = 'Security' -const APF_AUTH_TITLE ='APF Authorize Load Libraries' +const APF_AUTH_TITLE = 'APF Authorize Load Libraries' const STC_TITTLE = 'Stcs' @@ -30,170 +30,168 @@ test.beforeAll(async () => { }); test.describe('securityTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let securityPage : SecurityPage; - let planningPage : PlanningPage; - let apfAuthPage : ApfAuthPage; - let networkingPage : NetworkingPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - networkingPage = new NetworkingPage(page); - apfAuthPage = new ApfAuthPage(page); - securityPage = new SecurityPage(page); - installationPage = new InstallationPage(page); - installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillAllFields(config.DATASET_PREFIX, - config.PARM_LIB, - config.PROC_LIB, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - await networkingPage.click_skipNetworking() - await apfAuthPage.click_skipApfAuth() - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test all required fields on security page', async ({ page }) => { - await expect(securityPage.product).toBeTruthy() - await expect(securityPage.admin).toBeTruthy() - await expect(securityPage.stc).toBeTruthy() - await expect(securityPage.sys_prog).toBeTruthy() - await expect(securityPage.user_zis).toBeTruthy() - await expect(securityPage.user_zowe).toBeTruthy() - await expect(securityPage.aux).toBeTruthy() - await expect(securityPage.stc_zowe).toBeTruthy() - await expect(securityPage.stc_zis).toBeTruthy() - await expect(securityPage.view_yaml).toBeTruthy() - await expect(securityPage.save_and_close).toBeTruthy() - await expect(securityPage.previous_step).toBeTruthy() - await expect(securityPage.skip_button).toBeTruthy() - await expect(securityPage.continue_CertificateSelector).toBeTruthy() - - }) - //needs to be done - test('test security with valid data', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, - config.SECURITY_STC, - config.SECURITY_SYSPROG, - config.SECURITY_USER_ZIS, - config.SECURITY_USER_ZOWE, - config.SECURITY_AUX, - config.SECURITY_STC_ZOWE, - config.SECURITY_STC_ZIS - ) - await securityPage.initializeSecurity() - const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(false); - }) - - test('click Previous step button', async ({ page }) => { - const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - const title = await securityPage.returnTitleOfPrevPage(); - expect(title).toBe(APF_AUTH_TITLE); - }) - - - test('test click skip security button', async ({ page }) => { - const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); - expect(isSkipSecurityEnable).toBe(true); - await securityPage.click_skipSecurity(); - const title = await securityPage.returnTitleOfstcPage() - expect(title).toBe(STC_TITTLE); - }) - - - test('Test continue to certificate button is disable', async ({ page }) => { - const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) - - test('Test view yaml button', async ({ page }) => { - await securityPage.viewYaml() - await expect(securityPage.editor_title_element).toBeTruthy(); - await securityPage.closeButton() - }) - - - - test('Test view job output', async ({ page }) => { - await securityPage.click_viewAndSubmitJob() - await expect(securityPage.editor_title_element).toBeTruthy() - await securityPage.closeButton() - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, - config.SECURITY_STC, - config.SECURITY_SYSPROG, - config.SECURITY_USER_ZIS, - config.SECURITY_USER_ZOWE, - config.SECURITY_AUX, - config.SECURITY_STC_ZOWE, - config.SECURITY_STC_ZIS - ) - await securityPage.click_saveAndClose() - await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const sysProg_value = await securityPage.get_sysProg_value(); - const admin_value = await securityPage.get_admin_value(); - const stc_value = await securityPage.get_stc_value(); - const userZowe_value = await securityPage.get_user_zowe_value(); - const userZis_value = await securityPage.get_user_zis_value(); - const aux_value = await securityPage.get_aux_value(); - const stcZis_value = await securityPage.get_stc_zis_value(); - const stcZowe_value = await securityPage.get_stc_zowe_value(); - expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); - expect(admin_value).toBe(process.env.SECURITY_ADMIN); - expect(stc_value).toBe(process.env.SECURITY_STC); - expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); - expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); - expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); - expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); - expect(aux_value).toBe(process.env.SECURITY_AUX); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let securityPage: SecurityPage; + let planningPage: PlanningPage; + let apfAuthPage: ApfAuthPage; + let networkingPage: NetworkingPage; + let installationTypePage: InstallationTypePage; + let installationPage: InstallationPage; + + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + networkingPage = new NetworkingPage(page); + apfAuthPage = new ApfAuthPage(page); + securityPage = new SecurityPage(page); + installationPage = new InstallationPage(page); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, + config.PROC_LIB, + config.PARM_LIB, + config.ZIS, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + await networkingPage.click_skipNetworking() + await apfAuthPage.click_skipApfAuth() + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test all required fields on security page', async ({ page }) => { + await expect(securityPage.product).toBeTruthy() + await expect(securityPage.admin).toBeTruthy() + await expect(securityPage.stc).toBeTruthy() + await expect(securityPage.sys_prog).toBeTruthy() + await expect(securityPage.user_zis).toBeTruthy() + await expect(securityPage.user_zowe).toBeTruthy() + await expect(securityPage.aux).toBeTruthy() + await expect(securityPage.stc_zowe).toBeTruthy() + await expect(securityPage.stc_zis).toBeTruthy() + await expect(securityPage.view_yaml).toBeTruthy() + await expect(securityPage.save_and_close).toBeTruthy() + await expect(securityPage.previous_step).toBeTruthy() + await expect(securityPage.skip_button).toBeTruthy() + await expect(securityPage.continue_CertificateSelector).toBeTruthy() + + }) + //needs to be done + test('test security with valid data', async ({ page }) => { + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, + config.SECURITY_STC, + config.SECURITY_SYSPROG, + config.SECURITY_USER_ZIS, + config.SECURITY_USER_ZOWE, + config.SECURITY_AUX, + config.SECURITY_STC_ZOWE, + config.SECURITY_STC_ZIS + ) + await securityPage.initializeSecurity() + const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(false); + }) + + test('click Previous step button', async ({ page }) => { + const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + const title = await securityPage.returnTitleOfPrevPage(); + expect(title).toBe(APF_AUTH_TITLE); + }) + + + test('test click skip security button', async ({ page }) => { + const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); + expect(isSkipSecurityEnable).toBe(true); + await securityPage.click_skipSecurity(); + const title = await securityPage.returnTitleOfstcPage() + expect(title).toBe(STC_TITTLE); + }) + + + test('Test continue to certificate button is disable', async ({ page }) => { + const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) + + test('Test view yaml button', async ({ page }) => { + await securityPage.viewYaml() + await expect(securityPage.editor_title_element).toBeTruthy(); + await securityPage.closeButton() + }) + + + + test('Test view job output', async ({ page }) => { + await securityPage.click_viewAndSubmitJob() + await expect(securityPage.editor_title_element).toBeTruthy() + await securityPage.closeButton() + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, + config.SECURITY_STC, + config.SECURITY_SYSPROG, + config.SECURITY_USER_ZIS, + config.SECURITY_USER_ZOWE, + config.SECURITY_AUX, + config.SECURITY_STC_ZOWE, + config.SECURITY_STC_ZIS + ) + await securityPage.click_saveAndClose() + await titlePage.clickOnResumeProgress(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const sysProg_value = await securityPage.get_sysProg_value(); + const admin_value = await securityPage.get_admin_value(); + const stc_value = await securityPage.get_stc_value(); + const userZowe_value = await securityPage.get_user_zowe_value(); + const userZis_value = await securityPage.get_user_zis_value(); + const aux_value = await securityPage.get_aux_value(); + const stcZis_value = await securityPage.get_stc_zis_value(); + const stcZowe_value = await securityPage.get_stc_zowe_value(); + expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); + expect(admin_value).toBe(process.env.SECURITY_ADMIN); + expect(stc_value).toBe(process.env.SECURITY_STC); + expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); + expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); + expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); + expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); + expect(aux_value).toBe(process.env.SECURITY_AUX); + }) }) \ No newline at end of file diff --git a/playwright_test/utils/config.ts b/playwright_test/utils/config.ts index 2acdca11..5ac87875 100644 --- a/playwright_test/utils/config.ts +++ b/playwright_test/utils/config.ts @@ -19,6 +19,7 @@ interface Config { AUTH_PLUGIN_LIB: string | undefined; PROC_LIB: string | undefined; PARM_LIB: string | undefined; + ZIS: string | undefined; JCL_LIB: string | undefined; LOAD_LIB: string | undefined; DOMAIN_NAME: string | undefined; @@ -31,7 +32,6 @@ interface Config { SECURITY_AUX: string | undefined; SECURITY_STC_ZOWE: string | undefined; SECURITY_STC_ZIS: string | undefined; - } const config: Config = { @@ -50,11 +50,12 @@ const config: Config = { ZOSMF_HOST: process.env.ZOSMF_HOST, ZOSMF_PORT: process.env.ZOSMF_PORT, ZOSMF_APP_ID: process.env.ZOSMF_APP_ID, - DATASET_PREFIX: process.env.DATASET_PREFIX, + DATASET_PREFIX: process.env.DATASET_PREFIX, AUTH_LOAD_LIB: process.env.AUTH_LOAD_LIB, AUTH_PLUGIN_LIB: process.env.AUTH_PLUGIN_LIB, PROC_LIB: process.env.PROC_LIB, PARM_LIB: process.env.PARM_LIB, + ZIS: process.env.ZIS, JCL_LIB: process.env.JCL_LIB, LOAD_LIB: process.env.LOAD_LIB, EXTERNAL_PORT: process.env.EXTERNAL_PORT, From 5a89b93b509eaf6d68b768235260eda6694c1ae4 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 25 Oct 2024 00:10:55 +0530 Subject: [PATCH 2/7] Reverted unwanted changes for Review tests Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 186 ++++++----- playwright_test/Pages/connection.page.ts | 5 + playwright_test/Pages/installation.page.ts | 21 +- playwright_test/Pages/launchConfig.page.ts | 226 +++++++------ playwright_test/Pages/planning.page.ts | 3 +- playwright_test/Pages/security.page.ts | 250 +++++++------- playwright_test/Pages/title.page.ts | 19 +- playwright_test/Tests/ApfAuth.spec.ts | 359 +++++++++++---------- playwright_test/Tests/Installation.spec.ts | 83 ++--- playwright_test/Tests/Networking.spec.ts | 156 ++++----- playwright_test/Tests/Review.spec.ts | 2 +- playwright_test/Tests/Security.spec.ts | 332 +++++++++---------- 12 files changed, 829 insertions(+), 813 deletions(-) diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 2c1f3418..953ad80f 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -1,7 +1,7 @@ -import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; +import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; +let electronApp: ElectronApplication -class ApfAuthPage { +class ApfAuthPage{ page: Page; pageTitle: Locator; continueButtonSelector: Locator; @@ -14,6 +14,7 @@ class ApfAuthPage { skip_apf_auth_button: Locator; continue_apfauth_setup: Locator; continue_security_setup: Locator; + continueButtonSelector: Locator; editor_title_element: Locator; installationTitle: Locator; APFAUTH_TITLE: Locator; @@ -23,25 +24,29 @@ class ApfAuthPage { licenseAgreement: Locator; acceptLicense: Locator; datasetPrefix: Locator; - authLoadLib: Locator; + authLoadLib:Locator; authpluginLib: Locator; - skipInstallation: Locator; - run_zwe_init_apfauth: Locator; - view_yaml: Locator; - view_submit_job: Locator; - view_job_output: Locator; - save_and_close: Locator; - skip_apf_auth: Locator; - previous_step: Locator; - securityTab_title: Locator; - initApfauth: Locator; - close_button: Locator; - auth_load_lib_value: Locator; - auth_plugin_lib_value: Locator; - dataset_prefix_value: Locator; - click_ApfAuth: Locator; - viewAndSubmitJob: Locator; - continueToComponentInstallation: Locator; + skipInstallation:Locator; + run_zwe_init_apfauth:Locator; + view_yaml:Locator; + view_submit_job:Locator; + view_job_output:Locator; + save_and_close:Locator; + skip_apf_auth:Locator; + previous_step:Locator; + securityTab_title:Locator; + initApfauth:Locator; + close_button:Locator; + securityTab_title:Locator; + auth_load_lib_value:Locator; + auth_plugin_lib_value:Locator; + dataset_prefix_value:Locator; + + + + + + constructor(page: Page) { this.page = page; @@ -67,11 +72,11 @@ class ApfAuthPage { this.authpluginLib = page.getByLabel('Auth Plugin Lib') this.click_ApfAuth = page.locator('//span[text()="Apf Auth"]'); 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")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.run_zwe_init_apfauth = page.locator('//button[contains(text(),"zwe init apfauth")]') + this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + 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")]') @@ -80,98 +85,105 @@ class ApfAuthPage { this.dataset_prefix_value = page.getByLabel('Dataset Prefix') this.auth_load_lib_value = page.getByLabel('APF Authorized Load Library') this.auth_plugin_lib_value = page.getByLabel('Zowe ZIS Plugins Load Library') - } - commonPage = new CommonPage(); + //this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]') + this.select_SMPE = page.locator('span:has-text("SMP/E")'); - async getApfAuthPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) + } + async returnTitleOfApfAuthPage(){ return await this.pageTitle.textContent({ timeout: 2000 }); } - async movetoApfAuthPage() { - await this.commonPage.waitForElement(this.click_ApfAuth) - await this.click_ApfAuth.click({ timeout: 9000 }) + async movetoApfAuthPage(){ + await this.click_ApfAuth.click({timeout: 9000}) + } + + 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 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 }) + 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 }) } - async initializeApfauth() { - await this.initApfauth.click() + async initializeApfauth(){ + await this.initApfauth.click() } - async isWriteConfigGreenCheckVisible() { - return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); + async isWriteConfigGreenCheckVisible(){ + return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isUploadConfigGreenCheckVisible() { - return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); + async isUploadConfigGreenCheckVisible(){ + return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isInitApfGreenCheckVisible() { - return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 }); + async isInitApfGreenCheckVisible(){ + return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isPreviousButtonEnable() { - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable(){ + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage() { - await this.previous_step_button.click({ timeout: 2000 }); - const installation_title = await this.installationTitle.textContent(); - return installation_title; + async returnTitleOfPrevPage(){ + await this.previous_step_button.click({ timeout: 2000 }); + const installation_title = await this.installationTitle.textContent(); + return installation_title; } - async viewYaml() { - await this.view_yaml.click({ timeout: 2000 }) + async viewYaml(){ + await this.view_yaml.click({ timeout: 2000 }) } - async closeButton() { - await this.close_button.click({ timeout: 5000 }) + async closeButton(){ + await this.close_button.click({ timeout: 5000 }) } - async click_viewAndSubmitJob() { - await this.viewAndSubmitJob.click({ timeout: 6000 }) + async click_viewAndSubmitJob(){ + await this.viewAndSubmitJob.click({ timeout: 6000 }) } - async click_previewJob() { - await this.view_job_output.click({ timeout: 6000 }) + async click_previewJob(){ + await this.view_job_output.click({ timeout: 6000 }) } - async is_skipApfAuthButtonEnable() { - return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 }); + async is_skipApfAuthButtonEnable(){ + return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 }); } - async click_skipApfAuth() { - await this.skip_apf_auth_button.click({ timeout: 2000 }); - const securityPage_title = await this.securityTab_title.textContent(); - return securityPage_title; + async click_skipApfAuth(){ + await this.skip_apf_auth_button.click({ timeout: 2000 }); + const securityPage_title = await this.securityTab_title.textContent(); + return securityPage_title; } - async open_monacoEditor() { - this.view_yaml.click({ timeout: 2000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor(){ + this.view_yaml.click({ timeout: 2000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable() { - return await this.continue_security_setup.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable(){ + return await this.continue_security_setup.isDisabled({ timeout: 5000 }); } - async click_saveAndClose() { - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose(){ + this.save_and_close.click({ timeout: 2000 }) } - async get_datasetPrefix_value() { - const dataset_prefix = await this.dataset_prefix_value.textContent(); - return dataset_prefix; + async get_datasetPrefix_value(){ + const dataset_prefix = await this.dataset_prefix_value.textContent(); + return dataset_prefix; } - async get_authPluginLib_value() { - const authPluginLib_value = await this.auth_plugin_lib_value.textContent(); - return authPluginLib_value; + async get_authPluginLib_value(){ + const authPluginLib_value = await this.auth_plugin_lib_value.textContent(); + return authPluginLib_value; } - async get_authLoadLib_value() { - const authPluginLib_value = await this.auth_load_lib_value.textContent(); - return authPluginLib_value; + async get_authLoadLib_value(){ + const authPluginLib_value = await this.auth_load_lib_value.textContent(); + return authPluginLib_value; } + + } -export default ApfAuthPage; \ No newline at end of file + export default ApfAuthPage; \ No newline at end of file diff --git a/playwright_test/Pages/connection.page.ts b/playwright_test/Pages/connection.page.ts index 12c92311..1b1f5324 100644 --- a/playwright_test/Pages/connection.page.ts +++ b/playwright_test/Pages/connection.page.ts @@ -20,6 +20,8 @@ class ConnectionPage{ this.validateCredential = page.locator("//button[contains(text(), 'Validate credentials')]") this.connectionPageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.resumeProgress = page.locator('//button[contains(text(),"Resume Progress")]') this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') this.greenCheckIconSelector = page.locator('.MuiContainer-root svg[data-testid="CheckCircleIcon"]') } @@ -72,6 +74,9 @@ class ConnectionPage{ return await this.continueButton.click(); } + async click_saveAndClose(){ + this.save_and_close.click({ timeout: 5000 }) + } async isContinueButtonVisible() { return await this.continueButton.isDisabled(); } diff --git a/playwright_test/Pages/installation.page.ts b/playwright_test/Pages/installation.page.ts index ba2fbe7a..0dc4d06f 100644 --- a/playwright_test/Pages/installation.page.ts +++ b/playwright_test/Pages/installation.page.ts @@ -190,15 +190,18 @@ class InstallationPage{ await this.installMVSDatasets.click(); } - async fillInstallationPageDetails(DATASET_PREFIX: string, PROC_LIB: string, PARM_LIB: string, ZIS: string, JCL_LIB: string, LOAD_LIB: string, AUTH_LOAD_LIB: string, AUTH_PLUGIN_LIB: string) { - await this.enterPrefix(DATASET_PREFIX) - await this.enterProcLib(PROC_LIB) - await this.enterParmLib(PARM_LIB) - await this.enterZis(ZIS) - await this.enterJclLib(JCL_LIB) - await this.enterLoadLib(LOAD_LIB) - await this.enterAuthLoadLib(AUTH_LOAD_LIB) - await this.enterAuthPluginLib(AUTH_PLUGIN_LIB) + async fillAllFields(datasetPrefix: string, parmLib: string, procLib: string, jclLib: string, loadLib: string, authLoadLib: string, authPluginLib: string){ + await this.enterPrefix(datasetPrefix); + await this.enterParmLib(parmLib); + await this.enterProcLib(procLib); + await this.enterJclLib(jclLib); + await this.enterLoadLib(loadLib); + await this.enterAuthLoadLib(authLoadLib); + await this.enterAuthPluginLib(authPluginLib); + await this.enterAuthLoadLib(authLoadLib); + await this.enterAuthPluginLib(authPluginLib); + await this.enterAuthLoadLib(authLoadLib); + await this.enterAuthPluginLib(authPluginLib); } } export default InstallationPage; diff --git a/playwright_test/Pages/launchConfig.page.ts b/playwright_test/Pages/launchConfig.page.ts index 88156db2..3ee02e33 100644 --- a/playwright_test/Pages/launchConfig.page.ts +++ b/playwright_test/Pages/launchConfig.page.ts @@ -1,7 +1,7 @@ -import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; +import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; +let electronApp: ElectronApplication -class LaunchConfigPage { +class LaunchConfigPage{ page: Page; pageTitle: Locator; fillValidation: Locator; @@ -9,26 +9,21 @@ class LaunchConfigPage { fillLogLevel: Locator; readYaml: Locator; previous_step_button: Locator; - continueToReviewPage: Locator; + continue_ReviewSelector: Locator; editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button: Locator; - view_yaml: Locator; - view_submit_job: Locator; - view_job_output: Locator; - save_and_close: Locator; - previous_step: Locator; - close_button: Locator; + skip_button:Locator; + view_yaml:Locator; + view_submit_job:Locator; + view_job_output:Locator; + save_and_close:Locator; + previous_step:Locator; + close_button:Locator; CONFPAGE_TITLE: Locator; continueToComponentInstallation: Locator; - click_launchConfig: Locator; - validation: Locator; - componentConfig: Locator; - fillConfigLaunchValue: Locator; - viewAndSubmitJob: Locator; - certificateTab_title: Locator; - errorMsg: Locator; + + constructor(page: Page) { this.page = page; @@ -48,22 +43,19 @@ class LaunchConfigPage { 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.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') this.previous_step = page.locator('//button[contains(text(),"Previous step")]') this.skip_button = page.locator('//button[contains(text(),"Skip")]') this.close_button = page.locator('//button[contains(text(), "Close")]') this.certificateTab_title = page.locator('//div[text()="Certificates"]') - this.continueToReviewPage = page.locator('//button[contains(text(), "Review")]') + this.continue_ReviewSelector = page.locator('//button[contains(text(), "Review")]') this.errorMsg = page.locator('//p[text()="is a required property"]') } - commonPage = new CommonPage(); - async getLaunchConfigurationPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } @@ -73,135 +65,135 @@ class LaunchConfigPage { await this.continueToComponentInstallation.click({ timeout: 5000 }) await this.click_launchConfig.click({ timeout: 5000 }) } - async returnTitleOfConfPage() { - const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); - return apfAuth_title; - } - async fillvalues(validation: string) { - await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); + async returnTitleOfConfPage(){ + const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); + return apfAuth_title; } - async fillvalues_logLevel(logLevel: string) { - await this.fillLogLevel.fill(logLevel, { timeout: 10000 }) + async fillvalues(validation:string){ + await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); } - async fillvaluescomponentConfig(componentConfig: string) { - await this.fillConfigLaunchValue.fill(componentConfig, { timeout: 10000 }) + async fillvalues_logLevel(logLevel:string){ + await this.fillLogLevel.fill(logLevel,{ timeout: 10000 }) + } + async fillvaluescomponentConfig(componentConfig:string){ + await this.fillConfigLaunchValue.fill(componentConfig,{ timeout: 10000 }) } - async get_validation_value() { - const inputLocator = await this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); - const value = await inputLocator.inputValue(); - console.log('Input field value:', value); - return value; + async get_validation_value(){ + const inputLocator = await this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); + const value = await inputLocator.inputValue(); + console.log('Input field value:', value); + return value; } - async get_validation_error_msg() { - const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); - console.log(errorText); - return errorText; + async get_validation_error_msg(){ + const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); + console.log(errorText); + return errorText; } - async get_logLevel_value() { - const value = await this.fillLogLevel.inputValue(); - console.log('Input field value:', value); - return value; + async get_logLevel_value(){ + const value = await this.fillLogLevel.inputValue(); + console.log('Input field value:', value); + return value; } - async get_componentConfig_value() { - const value = await this.fillConfigLaunchValue.inputValue(); - console.log('Input field value:', value); - return value; + async get_componentConfig_value(){ + const value = await this.fillConfigLaunchValue.inputValue(); + console.log('Input field value:', value); + return value; } - async viewYaml() { + async viewYaml(){ await this.view_yaml.click({ timeout: 5000 }) } - async closeButton() { - this.close_button.click({ timeout: 2000 }) + async closeButton(){ + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob() { - this.viewAndSubmitJob.click({ timeout: 2000 }) + async click_viewAndSubmitJob(){ + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob() { - this.view_job_output.click({ timeout: 2000 }) + async click_previewJob(){ + this.view_job_output.click({ timeout: 2000 }) } - async is_skipLaunchConfigButtonEnable() { - return await this.skip_button.isEnabled({ timeout: 5000 }); + async is_skipLaunchConfigButtonEnable(){ + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipLaunhConfig() { - await this.skip_button.click({ timeout: 2000 }); - const certificatePage_title = await this.certificateTab_title.textContent(); - return certificatePage_title; + async click_skipLaunhConfig(){ + await this.skip_button.click({ timeout: 2000 }); + const certificatePage_title = await this.certificateTab_title.textContent(); + return certificatePage_title; } - async isPreviousButtonEnable() { - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable(){ + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage() { - await this.previous_step_button.click({ timeout: 2000 }); - const certificate_title = await this.certificateTab_title.textContent(); - return certificate_title; + async returnTitleOfPrevPage(){ + await this.previous_step_button.click({ timeout: 2000 }); + const certificate_title = await this.certificateTab_title.textContent(); + return certificate_title; } - async open_monacoEditor() { - this.view_yaml.click({ timeout: 5000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor(){ + this.view_yaml.click({ timeout: 5000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable() { - return await this.continueToReviewPage.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable(){ + return await this.continue_ReviewSelector.isDisabled({ timeout: 5000 }); } - async click_saveAndClose() { - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose(){ + this.save_and_close.click({ timeout: 2000 }) } async read_yaml() { let previousScrollHeight = 0; let allText = ''; while (true) { - // Extract text from all div.view-line elements - const newText = await this.page.evaluate(() => { - const viewLines = document.querySelectorAll('.view-lines .view-line'); - let text = ''; - viewLines.forEach((line) => { - text += line.textContent + '\n'; + // Extract text from all div.view-line elements + const newText = await this.page.evaluate(() => { + const viewLines = document.querySelectorAll('.view-lines .view-line'); + let text = ''; + viewLines.forEach((line) => { + text += line.textContent + '\n'; + }); + return text; + }); + + // Append the new text to the existing text + allText += newText; + console.log(allText) + + // Scroll a little to load more content + await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + editor.scrollTop += 100; // Adjust the scroll amount as needed }); - return text; - }); - - // Append the new text to the existing text - allText += newText; - console.log(allText) - - // Scroll a little to load more content - await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - editor.scrollTop += 100; // Adjust the scroll amount as needed - }); - - // Wait for a brief moment for new content to load - await this.page.waitForTimeout(1000); // Adjust timeout as needed - - // Get the current scroll height - const currentScrollHeight = await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - return editor.scrollHeight; - }); - - // If the scroll height hasn't changed since the last iteration, we've reached the end - if (currentScrollHeight === previousScrollHeight) { - break; - } - - // Update the previous scroll height for the next iteration - previousScrollHeight = currentScrollHeight; + + // Wait for a brief moment for new content to load + await this.page.waitForTimeout(1000); // Adjust timeout as needed + + // Get the current scroll height + const currentScrollHeight = await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + return editor.scrollHeight; + }); + + // If the scroll height hasn't changed since the last iteration, we've reached the end + if (currentScrollHeight === previousScrollHeight) { + break; + } + + // Update the previous scroll height for the next iteration + previousScrollHeight = currentScrollHeight; } console.log('All text:', allText); return allText; - } +} } -export default LaunchConfigPage; \ No newline at end of file + export default LaunchConfigPage; \ No newline at end of file diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index bb499788..a59ed51e 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -29,7 +29,6 @@ class PlanningPage{ continueInstallationOptions: Locator; readyToProceedMessage: Locator; errorMessage: Locator; - save_and_close: Locator; constructor(page: Page) { this.page = page; @@ -60,7 +59,7 @@ class PlanningPage{ this.continueInstallationOptions = page.locator("//button[contains(text(), 'Continue to Installation Options')]") this.readyToProceedMessage = page.locator("//div[contains(@class,'MuiBox-root css-hieomr')]/p") this.errorMessage = page.locator("//div[contains(@class,'MuiAlert-message')]") - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') } async clickZoweInstallationLink(){ diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index f65ed545..91c7076d 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -1,7 +1,7 @@ -import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; +import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; +let electronApp: ElectronApplication -class SecurityPage { +class SecurityPage{ page: Page; pageTitle: Locator; writeConfig_greenCheckXpath: Locator; @@ -12,30 +12,27 @@ class SecurityPage { editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button: Locator; - view_yaml: Locator; - view_submit_job: Locator; - view_job_output: Locator; - save_and_close: Locator; - previous_step: Locator; - initSecurity: Locator; - close_button: Locator; - admin: Locator; - stc: Locator; - sys_prog: Locator; - user_zis: Locator; - user_zowe: Locator; - aux: Locator; - stc_zowe: Locator; - stc_zis: Locator; + skip_button:Locator; + view_yaml:Locator; + view_submit_job:Locator; + view_job_output:Locator; + save_and_close:Locator; + previous_step:Locator; + initSecurity:Locator; + close_button:Locator; + admin:Locator; + stc:Locator; + sys_prog:Locator; + user_zis:Locator; + user_zowe:Locator; + aux:Locator; + stc_zowe:Locator; + stc_zis:Locator; product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; - certificateTab_title: Locator; - mainXpath: string; - stc_mainXpath: string; - viewAndSubmitJob: Locator; - securityTab_title: Locator; + + constructor(page: Page) { this.page = page; @@ -52,165 +49,164 @@ class SecurityPage { this.mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[3]/div/div[2]/div/div/div' this.stc_mainXpath = '//html/body/div[1]/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[4]/div/div[2]/div/div/div/' this.product = page.locator('input[role="combobox"]') - this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]') + this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') this.previous_step = page.locator('//button[contains(text(),"Previous step")]') this.skip_button = page.locator('//button[contains(text(),"Skip ")]') this.initSecurity = page.locator("//button[contains(text(), 'Initialize Security Config')]") this.close_button = page.locator('//button[contains(text(), "Close")]') this.certificateTab_title = page.locator('//div[text()="Certificates"]') + this.stc_title = page.locator('//div[text()="Stcs"]') this.securityTab_title = page.locator('//div[text()="Security"]') this.continue_CertificateSelector = page.locator('//button[contains(text(), "Continue to STC Setup")]') + this.admin = page.getByLabel('Admin'); - this.stc = page.getByLabel('Stc'); - this.sys_prog = page.getByLabel('Sys Prog'); - this.user_zis = page.locator(this.mainXpath + '/div/div/div[2]/div/div/input'); - this.user_zowe = page.locator(this.mainXpath + '/div/div/div[1]/div/div/input'); - this.aux = page.getByLabel('Aux'); - this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); - this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); + this.stc = page.getByLabel('Stc'); + this.sys_prog = page.getByLabel('Sys Prog'); + this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/div/input'); + this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/div/input'); + this.aux = page.getByLabel('Aux'); + this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); + this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); } - commonPage = new CommonPage(); - async getSecurityPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async movetoSecurityPage() { - await this.licenseAgreement.click({ timeout: 9000 }) - await this.acceptLicense.click({ timeout: 9000 }) - await this.continueToComponentInstallation.click({ timeout: 5000 }) - await this.skip_button.click() - await this.skip_button.click() + async movetoSecurityPage(){ + await this.licenseAgreement.click({timeout: 9000}) + await this.acceptLicense.click({timeout: 9000}) + await this.continueToComponentInstallation.click({timeout: 5000}) + await this.skip_button.click() + await this.skip_button.click() } - async fillProduct(product: string) { - await this.product.fill(product, { timeout: 10000 }) + async fillProduct(product:string){ + await this.product.fill(product,{ timeout: 10000 }) } - async fillSecurityDetails(product: string, admin: string, stc: string, sys_prog: string, user_zis: string, user_zowe: string, aux: string, stc_zowe: string, stc_zis: string) { - await this.product.fill(product, { timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.admin.fill(admin, { timeout: 10000 }) - await this.stc.fill(stc, { timeout: 10000 }) - await this.sys_prog.fill(sys_prog, { timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.user_zis.fill(user_zis, { timeout: 10000 }) - await this.user_zowe.fill(user_zowe, { timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.aux.fill(aux, { timeout: 10000 }) - await this.stc_zowe.fill(stc_zowe, { timeout: 10000 }) - await this.stc_zis.fill(stc_zis, { timeout: 10000 }) + async fillSecurityDetails(product:string, admin:string,stc:string,sys_prog:string,user_zis:string,user_zowe:string,aux: string, stc_zowe: string, stc_zis:string){ + await this.product.fill(product,{ timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.admin.fill(admin,{ timeout: 10000 }) + await this.stc.fill(stc,{ timeout: 10000 }) + await this.sys_prog.fill(sys_prog,{ timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.user_zis.fill(user_zis,{ timeout: 10000 }) + await this.user_zowe.fill(user_zowe,{ timeout: 10000 }) + await this.page.waitForTimeout(8000); + await this.aux.fill(aux,{ timeout: 10000 }) + await this.stc_zowe.fill(stc_zowe,{ timeout: 10000 }) + await this.stc_zis.fill(stc_zis,{ timeout: 10000 }) } - async fillAdmin(admin: string) { - await this.admin.fill(admin, { timeout: 10000 }) + async fillAdmin(admin:string){ + await this.admin.fill(admin,{ timeout: 10000 }) } - async initializeSecurity() { - await this.initSecurity.click() + async initializeSecurity(){ + await this.initSecurity.click() } - async isWriteConfigGreenCheckVisible() { - return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); + async isWriteConfigGreenCheckVisible(){ + return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isUploadConfigGreenCheckVisible() { - await this.uploadYaml_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); + async isUploadConfigGreenCheckVisible(){ + await this.uploadYaml_greenCheckXpath.waitFor({ timeout: 50000 }); + return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isInitSecurityGreenCheckVisible() { - await this.init_security_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); + async isInitSecurityGreenCheckVisible(){ + await this.init_security_greenCheckXpath.waitFor({ timeout: 50000 }); + return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isPreviousButtonEnable() { - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable(){ + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage() { - await this.previous_step_button.click({ timeout: 2000 }); - const apfAuth_title = await this.APFAUTH_TITLE.textContent(); - return apfAuth_title; + async returnTitleOfPrevPage(){ + await this.previous_step_button.click({ timeout: 2000 }); + const apfAuth_title = await this.APFAUTH_TITLE.textContent(); + return apfAuth_title; } - async viewYaml() { + async viewYaml(){ await this.view_yaml.click({ timeout: 2000 }) } - async closeButton() { - this.close_button.click({ timeout: 2000 }) + async closeButton(){ + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob() { - this.viewAndSubmitJob.click({ timeout: 2000 }) + async click_viewAndSubmitJob(){ + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob() { - this.view_job_output.click({ timeout: 2000 }) + async click_previewJob(){ + this.view_job_output.click({ timeout: 2000 }) } - async is_skipSecurityButtonEnable() { - return await this.skip_button.isEnabled({ timeout: 5000 }); + async is_skipSecurityButtonEnable(){ + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipSecurity() { - await this.skip_button.click({ timeout: 2000 }); + async click_skipSecurity(){ + await this.skip_button.click({ timeout: 2000 }); } - async open_monacoEditor() { - this.view_yaml.click({ timeout: 2000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor(){ + this.view_yaml.click({ timeout: 2000 }) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable() { - return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable(){ + return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } - async click_saveAndClose() { - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose(){ + this.save_and_close.click({ timeout: 2000 }) } - async get_admin_value() { - const admin_value = await this.admin.textContent(); - return admin_value; + async get_admin_value(){ + const admin_value = await this.admin.textContent(); + return admin_value; } - async get_stc_value() { - const stc_value = await this.stc.textContent(); - return stc_value; + async get_stc_value(){ + const stc_value = await this.stc.textContent(); + return stc_value; } - async get_user_zowe_value() { - const userZowe_value = await this.user_zowe.textContent(); - return userZowe_value; + async get_user_zowe_value(){ + const userZowe_value = await this.user_zowe.textContent(); + return userZowe_value; } - async get_user_zis_value() { - const userZis_value = await this.user_zis.textContent(); - return userZis_value; + async get_user_zis_value(){ + const userZis_value = await this.user_zis.textContent(); + return userZis_value; } - async get_aux_value() { - const aux_value = await this.aux.textContent(); - return aux_value; + async get_aux_value(){ + const aux_value = await this.aux.textContent(); + return aux_value; } - async get_stc_zis_value() { - const stcZis_value = await this.stc_zis.textContent(); - return stcZis_value; + async get_stc_zis_value(){ + const stcZis_value = await this.stc_zis.textContent(); + return stcZis_value; } - async get_stc_zowe_value() { - const stcZowe_value = await this.stc_zowe.textContent(); - return stcZowe_value; + async get_stc_zowe_value(){ + const stcZowe_value = await this.stc_zowe.textContent(); + return stcZowe_value; } - async get_sysProg_value() { - const sysProg_value = await this.sys_prog.textContent(); - return sysProg_value; + async get_sysProg_value(){ + const sysProg_value = await this.sys_prog.textContent(); + return sysProg_value; } - async returnTitleOfSecurityPage() { - const securityPage_title = await this.securityTab_title.textContent(); - return securityPage_title; + async returnTitleOfSecurityPage(){ + const securityPage_title = await this.securityTab_title.textContent(); + return securityPage_title; } - async returnTitleOfCertPage() { + async returnTitleOfCertPage(){ const certPage_title = await this.certificateTab_title.textContent(); return certPage_title; } - async returnTitleOfstcPage() { - const stcPage_title = await this.stc_title.textContent(); - return stcPage_title; + async returnTitleOfstcPage(){ + const stcPage_title = await this.stc_title.textContent(); + return stcPage_title; } } diff --git a/playwright_test/Pages/title.page.ts b/playwright_test/Pages/title.page.ts index a927b3f9..83640049 100644 --- a/playwright_test/Pages/title.page.ts +++ b/playwright_test/Pages/title.page.ts @@ -1,5 +1,4 @@ -import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; +import { Page,Locator } from '@playwright/test'; class TitlePage { page: Page; @@ -14,16 +13,14 @@ class TitlePage { this.resumeProgressButton = page.locator("//button[text()='Resume Progress']") } - commonPage = new CommonPage(); - - async navigateToConnectionTab() { - await this.commonPage.waitForElement(this.zoweInstallButton) - await this.zoweInstallButton.click({ timeout: 9000 }) + async navigateToConnectionTab(){ + await this.zoweInstallButton.click({timeout: 9000}) } - async clickOnResumeProgress() { - await this.commonPage.waitForElement(this.resumeProgressButton) - await this.resumeProgressButton.click({ timeout: 3000 }) + async clickOnResumeProgress(){ + await this.resumeProgressButton.click({timeout: 3000}) } + } -export default TitlePage; \ No newline at end of file + + export default TitlePage; \ No newline at end of file diff --git a/playwright_test/Tests/ApfAuth.spec.ts b/playwright_test/Tests/ApfAuth.spec.ts index d0229299..2b3da7f0 100644 --- a/playwright_test/Tests/ApfAuth.spec.ts +++ b/playwright_test/Tests/ApfAuth.spec.ts @@ -1,4 +1,4 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; +import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; import { prepareEnvironment } from '../prepare.js'; import ApfAuthPage from '../Pages/ApfAuth.page'; import TitlePage from '../Pages/title.page'; @@ -8,14 +8,18 @@ import InstallationTypePage from '../Pages/installationType.page'; import InstallationPage from '../Pages/installation.page.ts'; import NetworkingPage from '../Pages/networking.page'; import config from '../utils/config'; +import { spawn } from 'child_process'; +import path from 'path'; let page: Page; + let electronApp: ElectronApplication -const APF_AUTH_TITLE = 'APF Authorize Load Libraries' +const APF_AUTH_TITLE ='APF Authorize Load Libraries' const NETWORKING_TITLE = 'Networking' const INSTALLATION_TITLE = 'Installation' const SECURITY_TITLE = 'Security' + test.beforeAll(async () => { try { await prepareEnvironment({ install: true, remove: false }); @@ -25,179 +29,182 @@ test.beforeAll(async () => { } }); + test.describe('ApfAuthTab', () => { - let connectionPage: ConnectionPage; - let titlePage: TitlePage; - let apfAuthPage: ApfAuthPage; - let planningPage: PlanningPage; - let installationTypePage: InstallationTypePage; - let installationPage: InstallationPage; - let networkingPage: NetworkingPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page = await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page) - apfAuthPage = new ApfAuthPage(page); - installationTypePage = new InstallationTypePage(page); - installationPage = new InstallationPage(page); - networkingPage = new NetworkingPage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, - config.PROC_LIB, - config.PARM_LIB, - config.ZIS, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - await networkingPage.click_skipNetworking() - await page.waitForTimeout(1000); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - test('Test Resume Progress', async ({ page }) => { - apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) - apfAuthPage.click_saveAndClose() - connectionPage.click_resumeProgress() - const title = await apfAuthPage.returnTitleOfApfAuthPage(); - expect(title).toBe(config.APF_AUTH_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); - const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); - expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); - expect(AuthLoadLib_Value).toBe(config.AUTH_LOAD_LIB); - expect(AuthPluginLib_Value).toBe(config.AUTH_PLUGIN_LIB); - }) - - test('Verify title', async ({ page }) => { - apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - await expect(apfAuthPage.datasetPrefix).toBeTruthy() - await expect(apfAuthPage.authLoadLib).toBeTruthy() - await expect(apfAuthPage.authpluginLib).toBeTruthy() - await expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() - await expect(apfAuthPage.view_yaml).toBeTruthy() - await expect(apfAuthPage.save_and_close).toBeTruthy() - await expect(apfAuthPage.previous_step).toBeTruthy() - await expect(apfAuthPage.skip_apf_auth).toBeTruthy() - await expect(apfAuthPage.continue_security_setup).toBeTruthy() - - }) - test('test apfAuth with empty data', async ({ page }) => { - apfAuthPage.fillApfDetails('', '', '') - apfAuthPage.movetoApfAuthPage() - apfAuthPage.initializeApfauth() - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(false); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(false); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(false); - }) - test('test apfAuth with valid data', async ({ page }) => { - apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - apfAuthPage.initializeApfauth() - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(true); - }) - - test('click Previous step', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const title = await apfAuthPage.returnTitleOfPrevPage(); - expect(title).toBe(NETWORKING_TITLE); - }) - - test('test skip apfAuth button is enable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); - expect(isSkipApfAuthEnable).toBe(true); - }) - - test('test previous button is enabled', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - }) - - test('test continue button is disable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) - - test('click view yaml button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.viewYaml() - await expect(apfAuthPage.editor_title_element).toBeTruthy(); - apfAuthPage.closeButton() - }) - - test('test click skip APFAuth button', async ({ page }) => { - await apfAuthPage.movetoApfAuthPage() - const security_title = await apfAuthPage.click_skipApfAuth(); - expect(security_title).toBe(SECURITY_TITLE); - - }) - - test('Test view and submit button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_viewAndSubmitJob() - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - }) - - - test('Test view job', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_previewJob() - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) - apfAuthPage.movetoApfAuthPage() - apfAuthPage.click_saveAndClose() - titlePage.clickOnResumeProgress(); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); - const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); - expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); - expect(authLoadLibValue).toBe(config.AUTH_LOAD_LIB); - expect(authPluginLibValue).toBe(config.AUTH_PLUGIN_LIB); - }) + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let apfAuthPage : ApfAuthPage; + let planningPage : PlanningPage; + let installationTypePage : InstallationTypePage; + let installationPage : InstallationPage; + let networkingPage : NetworkingPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page) + apfAuthPage = new ApfAuthPage(page); + installationTypePage = new InstallationTypePage(page); + installationPage = new InstallationPage(page); + networkingPage = new NetworkingPage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillAllFields(config.DATASET_PREFIX, + config.PARM_LIB, + config.PROC_LIB, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + await networkingPage.click_skipNetworking() + await page.waitForTimeout(1000); + }) + + test.afterEach(async () => { + await electronApp.close() + }) + test('Test Resume Progress', async ({ page }) => { + apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) + apfAuthPage.click_saveAndClose() + connectionPage.click_resumeProgress() + const title = await apfAuthPage.returnTitleOfApfAuthPage(); + expect(title).toBe(config.APF_AUTH_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); + const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); + expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); + expect(AuthLoadLib_Value).toBe(config.AUTH_LOAD_LIB); + expect(AuthPluginLib_Value).toBe(config.AUTH_PLUGIN_LIB); + }) + + test('Verify title', async ({ page }) => { + apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + await expect(apfAuthPage.datasetPrefix).toBeTruthy() + await expect(apfAuthPage.authLoadLib).toBeTruthy() + await expect(apfAuthPage.authpluginLib).toBeTruthy() + await expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() + await expect(apfAuthPage.view_yaml).toBeTruthy() + await expect(apfAuthPage.save_and_close).toBeTruthy() + await expect(apfAuthPage.previous_step).toBeTruthy() + await expect(apfAuthPage.skip_apf_auth).toBeTruthy() + await expect(apfAuthPage.continue_security_setup).toBeTruthy() + + }) + test('test apfAuth with empty data', async ({ page }) => { + apfAuthPage.fillApfDetails('','','') + apfAuthPage.movetoApfAuthPage() + apfAuthPage.initializeApfauth() + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(false); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); + expect(isUploadConfig_check_visible).toBe(false); + const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); + expect(isInitApf_check_visible).toBe(false); + }) + test('test apfAuth with valid data', async ({ page }) => { + apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + apfAuthPage.initializeApfauth() + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); + expect(isInitApf_check_visible).toBe(true); + }) + + test('click Previous step', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const title = await apfAuthPage.returnTitleOfPrevPage(); + expect(title).toBe(NETWORKING_TITLE); + }) + + test('test skip apfAuth button is enable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); + expect(isSkipApfAuthEnable).toBe(true); + }) + + test('test previous button is enabled', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + }) + + test('test continue button is disable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) + + test('click view yaml button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.viewYaml() + await expect(apfAuthPage.editor_title_element).toBeTruthy(); + apfAuthPage.closeButton() + }) + + test('test click skip APFAuth button', async ({ page }) => { + await apfAuthPage.movetoApfAuthPage() + const security_title = await apfAuthPage.click_skipApfAuth(); + expect(security_title).toBe(SECURITY_TITLE); + + }) + + test('Test view and submit button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_viewAndSubmitJob() + await expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + }) + + + test('Test view job', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_previewJob() + await expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + apfAuthPage.fillApfDetails(config.DATASET_PREFIX, config.AUTH_LOAD_LIB, config.AUTH_PLUGIN_LIB) + apfAuthPage.movetoApfAuthPage() + apfAuthPage.click_saveAndClose() + titlePage.clickOnResumeProgress(); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); + const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); + expect(datatsetPrefixValue).toBe(config.DATASET_PREFIX); + expect(authLoadLibValue).toBe(config.AUTH_LOAD_LIB); + expect(authPluginLibValue).toBe(config.AUTH_PLUGIN_LIB); + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/Installation.spec.ts b/playwright_test/Tests/Installation.spec.ts index 2f2655fc..c60385a7 100644 --- a/playwright_test/Tests/Installation.spec.ts +++ b/playwright_test/Tests/Installation.spec.ts @@ -16,11 +16,11 @@ const DOWNLOAD_ZOWE_TITLE = 'Download Zowe Pax'; test.describe('InstallationTab', () => { let connectionPage: ConnectionPage; - let titlePage: TitlePage; - let installationTypePage: InstallationTypePage; - let planningPage: PlanningPage; - let installationPage: InstallationPage; - let networkingPage: NetworkingPage + let titlePage : TitlePage; + let installationTypePage : InstallationTypePage; + let planningPage : PlanningPage; + let installationPage : InstallationPage; + let networkingPage : NetworkingPage test.beforeEach(async ({ page }) => { @@ -39,20 +39,23 @@ test.describe('InstallationTab', () => { await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); await planningPage.clickValidateLocations() await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() + await installationTypePage.skipUnpax() }) test.afterEach(async () => { @@ -78,24 +81,23 @@ test.describe('InstallationTab', () => { expect(installationPage.clickContinueToNetworkSetup).toBeTruthy() const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_disable).toBe(true); - }) + }) test('Test Installation with Valid Data with Download Pax', async ({ page }) => { - await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, - config.PROC_LIB, - config.PARM_LIB, - config.ZIS, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) + await installationPage.fillAllFields(config.DATASET_PREFIX, + config.PARM_LIB, + config.PROC_LIB, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) await installationPage.clickInstallMvsDatasets(); const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_enable).toBe(true); await installationPage.clickContinueToNetworkSetup(); const networkconfig_title = await networkingPage.returnTitleOfNetworkingPage() - expect(networkconfig_title).toBe(NETWORKING_PAGE_TITLE); + expect (networkconfig_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with the Invalid Data', async ({ page }) => { @@ -107,7 +109,7 @@ test.describe('InstallationTab', () => { await installationPage.enterAuthLoadLib('AuthLoad') await installationPage.enterAuthPluginLib('') await installationPage.clickInstallMvsDatasetsInvalid(); - await installationPage.clickCloseEditor(); + await installationPage.clickCloseEditor(); const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_enable).toBe(false); }) @@ -121,9 +123,9 @@ test.describe('InstallationTab', () => { test('Test Skip Installation Button', async ({ page }) => { const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupEnabled(); expect(is_Continue_Button_disable).toBe(false); - const is_Skip_Button_disable = await installationPage.isSkipToNetworkSetupEnabled(); + const is_Skip_Button_disable = await installationPage.isSkipToNetworkSetupEnabled(); expect(is_Skip_Button_disable).toBe(false); - const title = await installationTypePage.getInstallationTypePageTitle(); + const title = await installationTypePage.getInstallationTypePageTitle(); expect(title).toBe(INSTALLATION_TYPE_TITLE); }) @@ -139,19 +141,18 @@ test.describe('InstallationTab', () => { await installationPage.clickCloseEditor() }) - test('Test Save and Close and Resume Progress', async ({ page }) => { - await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, - config.PROC_LIB, - config.PARM_LIB, - config.ZIS, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) + test('Test Save and Close and Resume Progress', async ({page}) => { + await installationPage.fillAllFields(config.DATASET_PREFIX, + config.PARM_LIB, + config.PROC_LIB, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) await installationPage.clickSaveAndClose(); await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); const prefix_value = await installationPage.getPrefixValue(); const procLib_value = await installationPage.getProclibValue(); diff --git a/playwright_test/Tests/Networking.spec.ts b/playwright_test/Tests/Networking.spec.ts index b2416a37..43428729 100644 --- a/playwright_test/Tests/Networking.spec.ts +++ b/playwright_test/Tests/Networking.spec.ts @@ -29,64 +29,66 @@ test.beforeAll(async () => { }); test.describe('networkingTab', () => { - let connectionPage: ConnectionPage; - let titlePage: TitlePage; - let securityPage: SecurityPage; - let planningPage: PlanningPage; - let networkingPage: NetworkingPage; - let installationTypePage: InstallationTypePage; - let installationPage: InstallationPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page = await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - networkingPage = new NetworkingPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - installationPage = new InstallationPage(page); - installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, - config.PROC_LIB, - config.PARM_LIB, - config.ZIS, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - }) - - test.afterEach(async () => { - await electronApp.close() - }) + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let securityPage : SecurityPage; + let planningPage : PlanningPage; + let networkingPage : NetworkingPage; + let installationTypePage : InstallationTypePage; + let installationPage : InstallationPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + networkingPage = new NetworkingPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + installationPage = new InstallationPage(page); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillAllFields(config.DATASET_PREFIX, + config.PARM_LIB, + config.PROC_LIB, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + }) + + test.afterEach(async () => { + await electronApp.close() + }) test('test title of page', async ({ page }) => { - const title = await networkingPage.returnTitleOfNetworkingPage(); - expect(title).toBe(NETWORKING_TITLE); - }) + const title = await networkingPage.returnTitleOfNetworkingPage(); + expect(title).toBe(NETWORKING_TITLE); + }) test('test all required fields', async ({ page }) => { await expect(networkingPage.externalDomains).toBeTruthy() @@ -106,7 +108,7 @@ test.describe('networkingTab', () => { await expect(networkingPage.appServer).toBeTruthy() await expect(networkingPage.cachingService).toBeTruthy() await expect(networkingPage.discovery).toBeTruthy() - }) + }) test('test external domain field', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); @@ -136,49 +138,49 @@ test.describe('networkingTab', () => { test('test enabled metric service debug', async ({ page }) => { const beforeClick = await networkingPage.isMetricsServiceDebugChecked(); - expect(beforeClick).toBe(false); - await networkingPage.clickMetricsServiceDebug(); - const afterClick = await networkingPage.isMetricsServiceDebugChecked(); - expect(afterClick).toBe(true); + expect(beforeClick).toBe(false); + await networkingPage.clickMetricsServiceDebug(); + const afterClick = await networkingPage.isMetricsServiceDebugChecked(); + expect(afterClick).toBe(true); }) test('Test view yaml button', async ({ page }) => { await networkingPage.viewYaml() await expect(networkingPage.editor_title_element).toBeTruthy(); await networkingPage.closeButton() - }) + }) test('Test save and close', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); await networkingPage.click_saveAndClose() await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); const title = await networkingPage.returnTitleOfNetworkingPage(); expect(title).toBe(NETWORKING_TITLE); const port = await networkingPage.get_externalDomainport_value(); const domainName = await networkingPage.get_externalDomainName_value(); expect(port).toBe(config.EXTERNAL_PORT); expect(domainName).toBe(config.DOMAIN_NAME); - }) + }) test('click Previous step button', async ({ page }) => { - const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - const title = await networkingPage.returnTitleOfPrevPage(); - expect(title).toBe(INSTALLATION_TITLE); - }) + const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + const title = await networkingPage.returnTitleOfPrevPage(); + expect(title).toBe(INSTALLATION_TITLE); + }) test('Test continue to APF Auth button is disable', async ({ page }) => { - const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) + const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) test('Test Skip networking button is enable', async ({ page }) => { - const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); - expect(isLaunchConfigEnable).toBe(true); - }) + const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); + expect(isLaunchConfigEnable).toBe(true); + }) test('Test yaml should be updated', async ({ page }) => { await networkingPage.fillexternal_domainvalues(config.DOMAIN_NAME, config.EXTERNAL_PORT); @@ -187,5 +189,5 @@ test.describe('networkingTab', () => { const yaml = await networkingPage.read_yaml(); expect(yaml).toContain(config.DOMAIN_NAME); expect(yaml).toContain(config.EXTERNAL_PORT); - }) + }) }); diff --git a/playwright_test/Tests/Review.spec.ts b/playwright_test/Tests/Review.spec.ts index 65587dc9..5aeb1cc8 100644 --- a/playwright_test/Tests/Review.spec.ts +++ b/playwright_test/Tests/Review.spec.ts @@ -150,7 +150,7 @@ test.describe('ReviewTab', () => { test('Test Navigation to Apf Auth page', async ({ page }) => { reviewPage.clickApfAuthTab(); await page.waitForTimeout(1000); - const apfAuth_title = await apfAuthPage.getApfAuthPageTitle(); + const apfAuth_title = await apfAuthPage.returnTitleOfApfAuthPage(); expect(apfAuth_title).toBe(APF_AUTH_PAGE_TITLE); }) diff --git a/playwright_test/Tests/Security.spec.ts b/playwright_test/Tests/Security.spec.ts index 21a60a4c..07a71c56 100644 --- a/playwright_test/Tests/Security.spec.ts +++ b/playwright_test/Tests/Security.spec.ts @@ -16,7 +16,7 @@ let page: Page; let electronApp: ElectronApplication const CERTIFICATE_TITLE = 'Certificates' const SECURITY_TITLE = 'Security' -const APF_AUTH_TITLE = 'APF Authorize Load Libraries' +const APF_AUTH_TITLE ='APF Authorize Load Libraries' const STC_TITTLE = 'Stcs' @@ -30,168 +30,170 @@ test.beforeAll(async () => { }); test.describe('securityTab', () => { - let connectionPage: ConnectionPage; - let titlePage: TitlePage; - let securityPage: SecurityPage; - let planningPage: PlanningPage; - let apfAuthPage: ApfAuthPage; - let networkingPage: NetworkingPage; - let installationTypePage: InstallationTypePage; - let installationPage: InstallationPage; - - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page = await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - networkingPage = new NetworkingPage(page); - apfAuthPage = new ApfAuthPage(page); - securityPage = new SecurityPage(page); - installationPage = new InstallationPage(page); - installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await installationPage.fillInstallationPageDetails(config.DATASET_PREFIX, - config.PROC_LIB, - config.PARM_LIB, - config.ZIS, - config.JCL_LIB, - config.LOAD_LIB, - config.AUTH_LOAD_LIB, - config.AUTH_PLUGIN_LIB - ) - await installationPage.clickInstallMvsDatasets(); - await installationPage.clickContinueToNetworkSetup(); - await networkingPage.click_skipNetworking() - await apfAuthPage.click_skipApfAuth() - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test all required fields on security page', async ({ page }) => { - await expect(securityPage.product).toBeTruthy() - await expect(securityPage.admin).toBeTruthy() - await expect(securityPage.stc).toBeTruthy() - await expect(securityPage.sys_prog).toBeTruthy() - await expect(securityPage.user_zis).toBeTruthy() - await expect(securityPage.user_zowe).toBeTruthy() - await expect(securityPage.aux).toBeTruthy() - await expect(securityPage.stc_zowe).toBeTruthy() - await expect(securityPage.stc_zis).toBeTruthy() - await expect(securityPage.view_yaml).toBeTruthy() - await expect(securityPage.save_and_close).toBeTruthy() - await expect(securityPage.previous_step).toBeTruthy() - await expect(securityPage.skip_button).toBeTruthy() - await expect(securityPage.continue_CertificateSelector).toBeTruthy() - - }) - //needs to be done - test('test security with valid data', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, - config.SECURITY_STC, - config.SECURITY_SYSPROG, - config.SECURITY_USER_ZIS, - config.SECURITY_USER_ZOWE, - config.SECURITY_AUX, - config.SECURITY_STC_ZOWE, - config.SECURITY_STC_ZIS - ) - await securityPage.initializeSecurity() - const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(false); - }) - - test('click Previous step button', async ({ page }) => { - const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - const title = await securityPage.returnTitleOfPrevPage(); - expect(title).toBe(APF_AUTH_TITLE); - }) - - - test('test click skip security button', async ({ page }) => { - const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); - expect(isSkipSecurityEnable).toBe(true); - await securityPage.click_skipSecurity(); - const title = await securityPage.returnTitleOfstcPage() - expect(title).toBe(STC_TITTLE); - }) - - - test('Test continue to certificate button is disable', async ({ page }) => { - const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - }) - - test('Test view yaml button', async ({ page }) => { - await securityPage.viewYaml() - await expect(securityPage.editor_title_element).toBeTruthy(); - await securityPage.closeButton() - }) - - - - test('Test view job output', async ({ page }) => { - await securityPage.click_viewAndSubmitJob() - await expect(securityPage.editor_title_element).toBeTruthy() - await securityPage.closeButton() - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, - config.SECURITY_STC, - config.SECURITY_SYSPROG, - config.SECURITY_USER_ZIS, - config.SECURITY_USER_ZOWE, - config.SECURITY_AUX, - config.SECURITY_STC_ZOWE, - config.SECURITY_STC_ZIS - ) - await securityPage.click_saveAndClose() - await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const sysProg_value = await securityPage.get_sysProg_value(); - const admin_value = await securityPage.get_admin_value(); - const stc_value = await securityPage.get_stc_value(); - const userZowe_value = await securityPage.get_user_zowe_value(); - const userZis_value = await securityPage.get_user_zis_value(); - const aux_value = await securityPage.get_aux_value(); - const stcZis_value = await securityPage.get_stc_zis_value(); - const stcZowe_value = await securityPage.get_stc_zowe_value(); - expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); - expect(admin_value).toBe(process.env.SECURITY_ADMIN); - expect(stc_value).toBe(process.env.SECURITY_STC); - expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); - expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); - expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); - expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); - expect(aux_value).toBe(process.env.SECURITY_AUX); - }) + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let securityPage : SecurityPage; + let planningPage : PlanningPage; + let apfAuthPage : ApfAuthPage; + let networkingPage : NetworkingPage; + let installationTypePage : InstallationTypePage; + let installationPage : InstallationPage; + + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page= await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + networkingPage = new NetworkingPage(page); + apfAuthPage = new ApfAuthPage(page); + securityPage = new SecurityPage(page); + installationPage = new InstallationPage(page); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() + await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + await installationTypePage.continueToUnpax() + await installationTypePage.skipUnpax() + await installationPage.fillAllFields(config.DATASET_PREFIX, + config.PARM_LIB, + config.PROC_LIB, + config.JCL_LIB, + config.LOAD_LIB, + config.AUTH_LOAD_LIB, + config.AUTH_PLUGIN_LIB + ) + await installationPage.clickInstallMvsDatasets(); + await installationPage.clickContinueToNetworkSetup(); + await networkingPage.click_skipNetworking() + await apfAuthPage.click_skipApfAuth() + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test all required fields on security page', async ({ page }) => { + await expect(securityPage.product).toBeTruthy() + await expect(securityPage.admin).toBeTruthy() + await expect(securityPage.stc).toBeTruthy() + await expect(securityPage.sys_prog).toBeTruthy() + await expect(securityPage.user_zis).toBeTruthy() + await expect(securityPage.user_zowe).toBeTruthy() + await expect(securityPage.aux).toBeTruthy() + await expect(securityPage.stc_zowe).toBeTruthy() + await expect(securityPage.stc_zis).toBeTruthy() + await expect(securityPage.view_yaml).toBeTruthy() + await expect(securityPage.save_and_close).toBeTruthy() + await expect(securityPage.previous_step).toBeTruthy() + await expect(securityPage.skip_button).toBeTruthy() + await expect(securityPage.continue_CertificateSelector).toBeTruthy() + + }) + //needs to be done + test('test security with valid data', async ({ page }) => { + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, + config.SECURITY_STC, + config.SECURITY_SYSPROG, + config.SECURITY_USER_ZIS, + config.SECURITY_USER_ZOWE, + config.SECURITY_AUX, + config.SECURITY_STC_ZOWE, + config.SECURITY_STC_ZIS + ) + await securityPage.initializeSecurity() + const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(false); + }) + + test('click Previous step button', async ({ page }) => { + const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + const title = await securityPage.returnTitleOfPrevPage(); + expect(title).toBe(APF_AUTH_TITLE); + }) + + + test('test click skip security button', async ({ page }) => { + const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); + expect(isSkipSecurityEnable).toBe(true); + await securityPage.click_skipSecurity(); + const title = await securityPage.returnTitleOfstcPage() + expect(title).toBe(STC_TITTLE); + }) + + + test('Test continue to certificate button is disable', async ({ page }) => { + const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + }) + + test('Test view yaml button', async ({ page }) => { + await securityPage.viewYaml() + await expect(securityPage.editor_title_element).toBeTruthy(); + await securityPage.closeButton() + }) + + + + test('Test view job output', async ({ page }) => { + await securityPage.click_viewAndSubmitJob() + await expect(securityPage.editor_title_element).toBeTruthy() + await securityPage.closeButton() + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, + config.SECURITY_STC, + config.SECURITY_SYSPROG, + config.SECURITY_USER_ZIS, + config.SECURITY_USER_ZOWE, + config.SECURITY_AUX, + config.SECURITY_STC_ZOWE, + config.SECURITY_STC_ZIS + ) + await securityPage.click_saveAndClose() + await titlePage.clickOnResumeProgress(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const sysProg_value = await securityPage.get_sysProg_value(); + const admin_value = await securityPage.get_admin_value(); + const stc_value = await securityPage.get_stc_value(); + const userZowe_value = await securityPage.get_user_zowe_value(); + const userZis_value = await securityPage.get_user_zis_value(); + const aux_value = await securityPage.get_aux_value(); + const stcZis_value = await securityPage.get_stc_zis_value(); + const stcZowe_value = await securityPage.get_stc_zowe_value(); + expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); + expect(admin_value).toBe(process.env.SECURITY_ADMIN); + expect(stc_value).toBe(process.env.SECURITY_STC); + expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); + expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); + expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); + expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); + expect(aux_value).toBe(process.env.SECURITY_AUX); + }) }) \ No newline at end of file From cf33756464c9fbfdc5751df94832cd6eb739e617 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 25 Oct 2024 00:30:17 +0530 Subject: [PATCH 3/7] Reverted unwanted file changes to Staging Signed-off-by: sagar-1310 --- playwright_test/Pages/installation.page.ts | 38 +++++++++++----------- playwright_test/Pages/launchConfig.page.ts | 16 +++------ playwright_test/Pages/title.page.ts | 2 +- playwright_test/Tests/ApfAuth.spec.ts | 24 +++++++------- playwright_test/Tests/Installation.spec.ts | 28 ++++++++-------- playwright_test/Tests/Networking.spec.ts | 30 ++++++++--------- playwright_test/Tests/Security.spec.ts | 30 ++++++++--------- playwright_test/utils/config.ts | 5 ++- 8 files changed, 83 insertions(+), 90 deletions(-) diff --git a/playwright_test/Pages/installation.page.ts b/playwright_test/Pages/installation.page.ts index 0dc4d06f..ee8a1753 100644 --- a/playwright_test/Pages/installation.page.ts +++ b/playwright_test/Pages/installation.page.ts @@ -29,17 +29,17 @@ class InstallationPage{ this.procLib = page.locator("//label[text()='Proclib']//following-sibling::div/input") this.parmLib = page.locator("//label[text()='Parmlib']//following-sibling::div/input") this.zis = page.locator("//label[text()='Zis']//following-sibling::div/input") - this.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") - this.loadLib = page.locator("//label[text()='Loadlib']//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.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") - this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") - this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") - this.viewJobOutput = page.locator("//button[text()='View Job Output']") + this.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") + this.loadLib = page.locator("//label[text()='Loadlib']//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.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") + this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") + this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") + this.viewJobOutput = page.locator("//button[text()='View Job Output']") this.saveAndClose = page.locator("//button[text()='Save & close']") this.previousStep = page.locator("//button[text()='Previous step']") - this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") + this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") this.continueToNetworkSetup = page.locator("//button[text()='Continue to Network Setup']") this.editorTitleElement = page.locator("//h2[text()='Editor']") this.closeEditorButton = page.locator("//button[text()='Close']") @@ -58,17 +58,17 @@ class InstallationPage{ async getPrefixValue(): Promise { return await this.prefix.inputValue(); } - + async enterProcLib(proclib: string): Promise { await this.page.waitForTimeout(500) await this.procLib.fill(proclib); } - + async getProclibValue(): Promise { return await this.procLib.inputValue(); } - + async enterParmLib(parmlib: string): Promise{ await this.page.waitForTimeout(500) await this.parmLib.fill(parmlib); @@ -155,18 +155,18 @@ class InstallationPage{ async isContinueToNetworkSetupEnabled(){ return await this.continueToNetworkSetup.isEnabled() } - + async isSkipToNetworkSetupEnabled(){ return await this.skipInstallation.isEnabled() } - + private async waitForContinueButtonToBeEnabled(): Promise { - const timeout = 100000; - const interval = 500; + const timeout = 100000; + const interval = 500; const endTime = Date.now() + timeout; while (Date.now() < endTime) { if (await this.isContinueToNetworkSetupEnabled()) { - return; + return; } await this.page.waitForTimeout(interval); } @@ -185,11 +185,11 @@ class InstallationPage{ await this.page.waitForTimeout(500) await this.closeEditorButton.click(); } - + async clickInstallMvsDatasetsInvalid(){ await this.installMVSDatasets.click(); } - + async fillAllFields(datasetPrefix: string, parmLib: string, procLib: string, jclLib: string, loadLib: string, authLoadLib: string, authPluginLib: string){ await this.enterPrefix(datasetPrefix); await this.enterParmLib(parmLib); diff --git a/playwright_test/Pages/launchConfig.page.ts b/playwright_test/Pages/launchConfig.page.ts index 3ee02e33..1daf2d7a 100644 --- a/playwright_test/Pages/launchConfig.page.ts +++ b/playwright_test/Pages/launchConfig.page.ts @@ -3,7 +3,6 @@ let electronApp: ElectronApplication class LaunchConfigPage{ page: Page; - pageTitle: Locator; fillValidation: Locator; logLevel: Locator; fillLogLevel: Locator; @@ -27,7 +26,6 @@ class LaunchConfigPage{ constructor(page: Page) { this.page = page; - this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.click_launchConfig = page.locator('//span[text()="Launch Config"]') this.validation = page.getByLabel('Validation'); this.logLevel = page.getByLabel('LogLevel'); @@ -55,15 +53,11 @@ class LaunchConfigPage{ this.errorMsg = page.locator('//p[text()="is a required property"]') } - async getLaunchConfigurationPageTitle() { - return await this.pageTitle.textContent({ timeout: 2000 }); - } - - async movetoLaunchConfigPage() { - await this.licenseAgreement.click({ timeout: 9000 }) - await this.acceptLicense.click({ timeout: 9000 }) - await this.continueToComponentInstallation.click({ timeout: 5000 }) - await this.click_launchConfig.click({ timeout: 5000 }) + async movetoLaunchConfigPage(){ + await this.licenseAgreement.click({timeout: 9000}) + await this.acceptLicense.click({timeout: 9000}) + await this.continueToComponentInstallation.click({timeout: 5000}) + await this.click_launchConfig.click({timeout: 5000}) } async returnTitleOfConfPage(){ const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); diff --git a/playwright_test/Pages/title.page.ts b/playwright_test/Pages/title.page.ts index 83640049..0cb0a10a 100644 --- a/playwright_test/Pages/title.page.ts +++ b/playwright_test/Pages/title.page.ts @@ -16,7 +16,7 @@ class TitlePage { async navigateToConnectionTab(){ await this.zoweInstallButton.click({timeout: 9000}) } - + async clickOnResumeProgress(){ await this.resumeProgressButton.click({timeout: 3000}) } diff --git a/playwright_test/Tests/ApfAuth.spec.ts b/playwright_test/Tests/ApfAuth.spec.ts index 2b3da7f0..5d4b797d 100644 --- a/playwright_test/Tests/ApfAuth.spec.ts +++ b/playwright_test/Tests/ApfAuth.spec.ts @@ -25,7 +25,7 @@ test.beforeAll(async () => { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); @@ -54,17 +54,17 @@ test.describe('ApfAuthTab', () => { await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() diff --git a/playwright_test/Tests/Installation.spec.ts b/playwright_test/Tests/Installation.spec.ts index c60385a7..5fa352eb 100644 --- a/playwright_test/Tests/Installation.spec.ts +++ b/playwright_test/Tests/Installation.spec.ts @@ -33,22 +33,22 @@ test.describe('InstallationTab', () => { installationTypePage = new InstallationTypePage(page); installationPage = new InstallationPage(page); networkingPage = new NetworkingPage(page); - + titlePage.navigateToConnectionTab() await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() @@ -97,7 +97,7 @@ test.describe('InstallationTab', () => { expect(is_Continue_Button_enable).toBe(true); await installationPage.clickContinueToNetworkSetup(); const networkconfig_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkconfig_title).toBe(NETWORKING_PAGE_TITLE); + expect (networkconfig_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with the Invalid Data', async ({ page }) => { @@ -164,5 +164,5 @@ test.describe('InstallationTab', () => { expect(procLib_value).toBe(config.PROC_LIB); expect(authLoadLib_value).toBe(config.AUTH_LOAD_LIB); expect(authPluginLib_value).toBe(config.AUTH_PLUGIN_LIB); - }) + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/Networking.spec.ts b/playwright_test/Tests/Networking.spec.ts index 43428729..55202448 100644 --- a/playwright_test/Tests/Networking.spec.ts +++ b/playwright_test/Tests/Networking.spec.ts @@ -24,7 +24,7 @@ test.beforeAll(async () => { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); @@ -51,17 +51,17 @@ test.describe('networkingTab', () => { await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() @@ -89,7 +89,7 @@ test.describe('networkingTab', () => { const title = await networkingPage.returnTitleOfNetworkingPage(); expect(title).toBe(NETWORKING_TITLE); }) - + test('test all required fields', async ({ page }) => { await expect(networkingPage.externalDomains).toBeTruthy() await expect(networkingPage.externalPort).toBeTruthy() @@ -128,7 +128,7 @@ test.describe('networkingTab', () => { await networkingPage.add_DomainNameField(); await expect(networkingPage.domainName).toBeTruthy() }) - + test('test add special char in other port no', async ({ page }) => { const originalValue = await networkingPage.get_metricServiceport_value(); await networkingPage.fillMetricServicePort('*^%$^&'); @@ -176,7 +176,7 @@ test.describe('networkingTab', () => { const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); expect(is_ContinueButtonDisable).toBe(true); }) - + test('Test Skip networking button is enable', async ({ page }) => { const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); expect(isLaunchConfigEnable).toBe(true); diff --git a/playwright_test/Tests/Security.spec.ts b/playwright_test/Tests/Security.spec.ts index 07a71c56..3a296d04 100644 --- a/playwright_test/Tests/Security.spec.ts +++ b/playwright_test/Tests/Security.spec.ts @@ -56,17 +56,17 @@ test.describe('securityTab', () => { await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - '1', - config.JOB_NAME, - config.JOB_PREFIX, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + '1', + config.JOB_NAME, + config.JOB_PREFIX, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() @@ -111,8 +111,8 @@ test.describe('securityTab', () => { }) //needs to be done test('test security with valid data', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, config.SECURITY_STC, config.SECURITY_SYSPROG, config.SECURITY_USER_ZIS, @@ -163,8 +163,8 @@ test.describe('securityTab', () => { }) test('Test save and close and Resume Progress', async ({ page }) => { - await securityPage.fillSecurityDetails('RACF', - config.SECURITY_ADMIN, + await securityPage.fillSecurityDetails('RACF', + config.SECURITY_ADMIN, config.SECURITY_STC, config.SECURITY_SYSPROG, config.SECURITY_USER_ZIS, diff --git a/playwright_test/utils/config.ts b/playwright_test/utils/config.ts index 5ac87875..2acdca11 100644 --- a/playwright_test/utils/config.ts +++ b/playwright_test/utils/config.ts @@ -19,7 +19,6 @@ interface Config { AUTH_PLUGIN_LIB: string | undefined; PROC_LIB: string | undefined; PARM_LIB: string | undefined; - ZIS: string | undefined; JCL_LIB: string | undefined; LOAD_LIB: string | undefined; DOMAIN_NAME: string | undefined; @@ -32,6 +31,7 @@ interface Config { SECURITY_AUX: string | undefined; SECURITY_STC_ZOWE: string | undefined; SECURITY_STC_ZIS: string | undefined; + } const config: Config = { @@ -50,12 +50,11 @@ const config: Config = { ZOSMF_HOST: process.env.ZOSMF_HOST, ZOSMF_PORT: process.env.ZOSMF_PORT, ZOSMF_APP_ID: process.env.ZOSMF_APP_ID, - DATASET_PREFIX: process.env.DATASET_PREFIX, + DATASET_PREFIX: process.env.DATASET_PREFIX, AUTH_LOAD_LIB: process.env.AUTH_LOAD_LIB, AUTH_PLUGIN_LIB: process.env.AUTH_PLUGIN_LIB, PROC_LIB: process.env.PROC_LIB, PARM_LIB: process.env.PARM_LIB, - ZIS: process.env.ZIS, JCL_LIB: process.env.JCL_LIB, LOAD_LIB: process.env.LOAD_LIB, EXTERNAL_PORT: process.env.EXTERNAL_PORT, From e22d3c489144a8ac8db90d9b1f49f83abdcf50d6 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 25 Oct 2024 01:14:08 +0530 Subject: [PATCH 4/7] Added and Updated changes needed for Review tests Signed-off-by: sagar-1310 --- playwright_test/Pages/certificates.page.ts | 77 ---------------------- playwright_test/Pages/launchConfig.page.ts | 7 +- playwright_test/Pages/stcs.page.ts | 20 ++++++ playwright_test/Pages/vsam.page.ts | 20 ++++++ playwright_test/Tests/Review.spec.ts | 10 ++- 5 files changed, 52 insertions(+), 82 deletions(-) create mode 100644 playwright_test/Pages/stcs.page.ts create mode 100644 playwright_test/Pages/vsam.page.ts diff --git a/playwright_test/Pages/certificates.page.ts b/playwright_test/Pages/certificates.page.ts index c487ff84..359c8d4c 100644 --- a/playwright_test/Pages/certificates.page.ts +++ b/playwright_test/Pages/certificates.page.ts @@ -4,28 +4,10 @@ import CommonPage from './common.page'; class CertificatesPage { page: Page; pageTitle: Locator; - viewEditYaml: Locator; - viewSubmitJob: Locator; - viewJobOutput: Locator; - saveAndClose: Locator; - previousStep: Locator; - skipCertificates: Locator; - continueToLaunchSetup: Locator; - editorTitleElement: Locator; - closeEditorButton: Locator; constructor(page: Page) { this.page = page; this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") - this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']") - this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']") - this.viewJobOutput = page.locator("//button[text()='View Job Output']") - this.saveAndClose = page.locator("//button[text()='Save & close']") - this.previousStep = page.locator("//button[text()='Previous step']") - this.skipCertificates = page.locator("//button[contains(text(),'Skip')]") - this.continueToLaunchSetup = page.locator("//button[text()='Continue to Launch Setup']") - this.editorTitleElement = page.locator("//h2[text()='Editor']") - this.closeEditorButton = page.locator("//button[text()='Close']") } commonPage = new CommonPage(); @@ -34,64 +16,5 @@ class CertificatesPage { await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - - async clickViewEditYaml() { - await this.commonPage.waitForElement(this.viewEditYaml) - await this.viewEditYaml.click(); - } - - async clickViewSubmitJob() { - await this.commonPage.waitForElement(this.viewSubmitJob) - await this.viewSubmitJob.click(); - } - - async clickViewJobOutput() { - await this.commonPage.waitForElement(this.viewJobOutput) - await this.viewJobOutput.click(); - await this.page.waitForTimeout(2000); - } - - async clickSaveAndClose() { - await this.commonPage.waitForElement(this.saveAndClose) - await this.saveAndClose.click({ timeout: 2000 }); - } - - async clickPreviousStep() { - await this.commonPage.waitForElement(this.previousStep) - await this.previousStep.click(); - } - - async clickSkipCertificates() { - await this.commonPage.waitForElement(this.skipCertificates) - await this.skipCertificates.click(); - } - - async clickContinueToLaunchSetup() { - await this.commonPage.waitForElement(this.continueToLaunchSetup) - await this.continueToLaunchSetup.click(); - } - - async isContinueToLaunchSetupDisabled() { - await this.commonPage.waitForElement(this.continueToLaunchSetup) - return await this.continueToLaunchSetup.isDisabled() - } - - async isContinueToLaunchSetupEnabled() { - await this.commonPage.waitForElement(this.continueToLaunchSetup) - return await this.continueToLaunchSetup.isEnabled() - } - - async open_monacoEditor() { - await this.commonPage.waitForElement(this.viewEditYaml) - this.viewEditYaml.click({ timeout: 2000 }) - await this.commonPage.waitForElement(this.editorTitleElement) - const editor_title = await this.editorTitleElement.textContent(); - return editor_title; - } - - async clickCloseEditor() { - await this.commonPage.waitForElement(this.closeEditorButton) - await this.closeEditorButton.click(); - } } export default CertificatesPage; \ No newline at end of file diff --git a/playwright_test/Pages/launchConfig.page.ts b/playwright_test/Pages/launchConfig.page.ts index 1daf2d7a..64dce7f2 100644 --- a/playwright_test/Pages/launchConfig.page.ts +++ b/playwright_test/Pages/launchConfig.page.ts @@ -3,6 +3,7 @@ let electronApp: ElectronApplication class LaunchConfigPage{ page: Page; + pageTitle: Locator; fillValidation: Locator; logLevel: Locator; fillLogLevel: Locator; @@ -26,6 +27,7 @@ class LaunchConfigPage{ constructor(page: Page) { this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") this.click_launchConfig = page.locator('//span[text()="Launch Config"]') this.validation = page.getByLabel('Validation'); this.logLevel = page.getByLabel('LogLevel'); @@ -59,9 +61,8 @@ class LaunchConfigPage{ await this.continueToComponentInstallation.click({timeout: 5000}) await this.click_launchConfig.click({timeout: 5000}) } - async returnTitleOfConfPage(){ - const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); - return apfAuth_title; + async getLaunchConfigurationPageTitle() { + return await this.pageTitle.textContent({ timeout: 2000 }); } async fillvalues(validation:string){ await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); diff --git a/playwright_test/Pages/stcs.page.ts b/playwright_test/Pages/stcs.page.ts new file mode 100644 index 00000000..5083a6e1 --- /dev/null +++ b/playwright_test/Pages/stcs.page.ts @@ -0,0 +1,20 @@ +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; + +class StcsPage { + page: Page; + pageTitle: Locator; + + constructor(page: Page) { + this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") + } + + commonPage = new CommonPage(); + + async getStcsPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); + } +} +export default StcsPage; \ No newline at end of file diff --git a/playwright_test/Pages/vsam.page.ts b/playwright_test/Pages/vsam.page.ts new file mode 100644 index 00000000..23d060ee --- /dev/null +++ b/playwright_test/Pages/vsam.page.ts @@ -0,0 +1,20 @@ +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; + +class VsamPage { + page: Page; + pageTitle: Locator; + + constructor(page: Page) { + this.page = page; + this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") + } + + commonPage = new CommonPage(); + + async getVsamPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) + return await this.pageTitle.textContent({ timeout: 2000 }); + } +} +export default VsamPage; \ No newline at end of file diff --git a/playwright_test/Tests/Review.spec.ts b/playwright_test/Tests/Review.spec.ts index 5aeb1cc8..133ed29a 100644 --- a/playwright_test/Tests/Review.spec.ts +++ b/playwright_test/Tests/Review.spec.ts @@ -7,7 +7,9 @@ import InstallationPage from '../Pages/installation.page.ts'; import NetworkingPage from '../Pages/networking.page.ts'; import ApfAuthPage from '../Pages/ApfAuth.page.ts'; import SecurityPage from '../Pages/security.page.ts'; +import StcsPage from '../Pages/stcs.page.ts'; import CertificatesPage from '../Pages/certificates.page.ts'; +import VsamPage from '../Pages/vsam.page.ts'; import LaunchConfigPage from '../Pages/launchConfig.page'; import ReviewPage from '../Pages/review.page.ts'; import config from '../utils/config.ts'; @@ -36,7 +38,9 @@ test.describe('ReviewTab', () => { let networkingPage: NetworkingPage let apfAuthPage: ApfAuthPage let securityPage: SecurityPage + let stcsPage: StcsPage let certificatesPage: CertificatesPage; + let vsamPage: VsamPage let launchConfigPage: LaunchConfigPage; let reviewPage: ReviewPage; @@ -61,7 +65,9 @@ test.describe('ReviewTab', () => { networkingPage = new NetworkingPage(page); apfAuthPage = new ApfAuthPage(page); securityPage = new SecurityPage(page); + stcsPage = new StcsPage(page); certificatesPage = new CertificatesPage(page); + vsamPage = new VsamPage(page); launchConfigPage = new LaunchConfigPage(page); reviewPage = new ReviewPage(page); titlePage.navigateToConnectionTab() @@ -164,7 +170,7 @@ test.describe('ReviewTab', () => { test('Test Navigation to Stcs page', async ({ page }) => { reviewPage.clickStcsTab(); await page.waitForTimeout(1000); - const stcs_title = await securityPage.getSecurityPageTitle(); + const stcs_title = await stcsPage.getStcsPageTitle(); expect(stcs_title).toBe(STCS_PAGE_TITLE); }) @@ -178,7 +184,7 @@ test.describe('ReviewTab', () => { test('Test Navigation to Caching Service page', async ({ page }) => { reviewPage.clickCachingServiceTab(); await page.waitForTimeout(1000); - const cachingService_title = await securityPage.getSecurityPageTitle(); + const cachingService_title = await vsamPage.getVsamPageTitle(); expect(cachingService_title).toBe(CACHING_SERVICE_PAGE_TITLE); }) From d1b4d64685761e389d9a1eb2be76e00ebda5332a Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 25 Oct 2024 01:17:18 +0530 Subject: [PATCH 5/7] Removed commented code Signed-off-by: sagar-1310 --- playwright_test/Pages/common.page.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/playwright_test/Pages/common.page.ts b/playwright_test/Pages/common.page.ts index 624969d8..0c93fd02 100644 --- a/playwright_test/Pages/common.page.ts +++ b/playwright_test/Pages/common.page.ts @@ -26,7 +26,6 @@ class CommonPage { try { await this.page.waitForTimeout(1000); await locator.waitFor({ state: 'visible', timeout: 10000 }); - // await expect(locator).toBeVisible(); } catch (error) { console.error('Error while checking visibility of locator', error); return false; From 1a3101950f02aa7948f2f5be9c5eb0f01a26bc47 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Thu, 7 Nov 2024 01:50:23 +0530 Subject: [PATCH 6/7] Updated tests as per the suggestions Signed-off-by: sagar-1310 --- playwright_test/Pages/certificates.page.ts | 5 +- playwright_test/Pages/common.page.ts | 38 -------------- playwright_test/Pages/review.page.ts | 60 +++++++++++----------- playwright_test/Pages/stcs.page.ts | 4 +- playwright_test/Pages/vsam.page.ts | 6 +-- playwright_test/Tests/Review.spec.ts | 37 ++++++------- 6 files changed, 49 insertions(+), 101 deletions(-) delete mode 100644 playwright_test/Pages/common.page.ts diff --git a/playwright_test/Pages/certificates.page.ts b/playwright_test/Pages/certificates.page.ts index 359c8d4c..12427e59 100644 --- a/playwright_test/Pages/certificates.page.ts +++ b/playwright_test/Pages/certificates.page.ts @@ -1,5 +1,4 @@ import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; class CertificatesPage { page: Page; @@ -10,10 +9,8 @@ class CertificatesPage { this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") } - commonPage = new CommonPage(); - async getCertificatesPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) + await this.page.waitForTimeout(500); return await this.pageTitle.textContent({ timeout: 2000 }); } } diff --git a/playwright_test/Pages/common.page.ts b/playwright_test/Pages/common.page.ts deleted file mode 100644 index 0c93fd02..00000000 --- a/playwright_test/Pages/common.page.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Page, Locator, expect } from '@playwright/test'; - -class CommonPage { - page: Page; - - async getElementValue(element: Locator) { - const elementValue = await element.getAttribute('value') - return elementValue - } - - async isElementHasValue(element: Locator): Promise { - const elementValue = await element.getAttribute('value') - if (elementValue !== null && elementValue !== '') { - return true - } else { - return false - } - } - - async validateElementValue(textBoxLocator: Locator, expectedValue: string): Promise { - const insertedValue = await textBoxLocator.inputValue(); - return insertedValue === expectedValue; - } - - async waitForElement(locator: Locator) { - try { - await this.page.waitForTimeout(1000); - await locator.waitFor({ state: 'visible', timeout: 10000 }); - } catch (error) { - console.error('Error while checking visibility of locator', error); - return false; - } - await this.page.waitForTimeout(2000); - } - -} - -export default CommonPage; \ No newline at end of file diff --git a/playwright_test/Pages/review.page.ts b/playwright_test/Pages/review.page.ts index 7ed00deb..efbca438 100644 --- a/playwright_test/Pages/review.page.ts +++ b/playwright_test/Pages/review.page.ts @@ -1,5 +1,4 @@ import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; class ReviewPage { page: Page; @@ -18,8 +17,8 @@ class ReviewPage { cachingServiceTab: Locator; launchConfigTab: Locator; connectionTabSuccessfulIcon: Locator; - planningTabSuccessfulIcon: Locator; - installationTypeTabSuccessfulIcon: Locator; + planningTabPendingIcon: Locator; + installationTypeTabPendingIcon: Locator; initializationTabPendingIcon: Locator; installationTabPendingIcon: Locator; networkingTabPendingIcon: Locator; @@ -34,6 +33,7 @@ class ReviewPage { finishInstallation: Locator; editorTitleElement: Locator; closeEditorButton: Locator; + readOnlyEditor: Locator constructor(page: Page) { this.page = page; @@ -52,8 +52,8 @@ class ReviewPage { this.cachingServiceTab = page.locator("//p[text()='Caching Service']") this.launchConfigTab = page.locator("//p[text()='Launch Config']") this.connectionTabSuccessfulIcon = page.locator("//p[text()='Connection']/following-sibling::*[@data-testid='CheckCircleIcon']") - this.planningTabSuccessfulIcon = page.locator("//p[text()='Planning']/following-sibling::*[@data-testid='CheckCircleIcon']") - this.installationTypeTabSuccessfulIcon = page.locator("//p[text()='Installation Type']/following-sibling::*[@data-testid='CheckCircleIcon']") + this.planningTabPendingIcon = page.locator("//p[text()='Planning']/following-sibling::*[@data-testid='WarningIcon']") + this.installationTypeTabPendingIcon = page.locator("//p[text()='Installation Type']/following-sibling::*[@data-testid='WarningIcon']") this.initializationTabPendingIcon = page.locator("//p[text()='Initialization']/following-sibling::*[@data-testid='WarningIcon']") this.installationTabPendingIcon = page.locator("//p[text()='Installation']/following-sibling::*[@data-testid='WarningIcon']") this.networkingTabPendingIcon = page.locator("//p[text()='Networking']/following-sibling::*[@data-testid='WarningIcon']") @@ -68,123 +68,121 @@ class ReviewPage { this.finishInstallation = page.locator("//button[text()='Finish Installation']") this.editorTitleElement = page.locator("//h2[text()='Editor']") this.closeEditorButton = page.locator("//button[text()='Close']") + this.readOnlyEditor = page.locator("//h2[text()='Editor']/following-sibling::div[1]//div[@class='view-lines monaco-mouse-cursor-text']/div[1]") } - commonPage = new CommonPage(); - async getReviewPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) + await this.page.waitForTimeout(500); return await this.pageTitle.textContent({ timeout: 2000 }); } async clickReviewInstallationTab() { - await this.commonPage.waitForElement(this.reviewInstallationTab) + await this.page.waitForTimeout(500); await this.reviewInstallationTab.click(); } async clickConnectionTab() { - await this.commonPage.waitForElement(this.connectionTab) + await this.page.waitForTimeout(500); await this.connectionTab.click(); } async clickPlanningTab() { - await this.commonPage.waitForElement(this.planningTab) + await this.page.waitForTimeout(500); await this.planningTab.click(); } async clickInstallationTypeTab() { - await this.commonPage.waitForElement(this.installationTypeTab) + await this.page.waitForTimeout(500); await this.installationTypeTab.click(); } async clickInstallationTab() { - await this.commonPage.waitForElement(this.installationTab) + await this.page.waitForTimeout(500); await this.installationTab.click(); } async clickNetworkingTab() { - await this.commonPage.waitForElement(this.networkingTab) + await this.page.waitForTimeout(500); await this.networkingTab.click(); } async clickApfAuthTab() { - await this.commonPage.waitForElement(this.apfAuthTab) + await this.page.waitForTimeout(500); await this.apfAuthTab.click(); } async clickSecurityTab() { - await this.commonPage.waitForElement(this.securityTab) + await this.page.waitForTimeout(500); await this.securityTab.click(); } async clickStcsTab() { - await this.commonPage.waitForElement(this.stcsTab) + await this.page.waitForTimeout(500); await this.stcsTab.click(); } async clickCertificatesTab() { - await this.commonPage.waitForElement(this.certificatesTab) + await this.page.waitForTimeout(500); await this.certificatesTab.click(); } async clickCachingServiceTab() { - await this.commonPage.waitForElement(this.cachingServiceTab) + await this.page.waitForTimeout(500); await this.cachingServiceTab.click(); } async clickLaunchConfigTab() { - await this.commonPage.waitForElement(this.launchConfigTab) + await this.page.waitForTimeout(500); await this.launchConfigTab.click(); } async clickViewEditYaml() { - await this.commonPage.waitForElement(this.viewEditYaml) + await this.page.waitForTimeout(500); await this.viewEditYaml.click(); } async clickViewJobOutput() { - await this.commonPage.waitForElement(this.viewJobOutput) + await this.page.waitForTimeout(500); await this.viewJobOutput.click(); await this.page.waitForTimeout(2000); } async clickSaveAndClose() { - await this.commonPage.waitForElement(this.saveAndClose) + await this.page.waitForTimeout(500); await this.saveAndClose.click({ timeout: 2000 }); } async clickPreviousStep() { - await this.commonPage.waitForElement(this.previousStep) + await this.page.waitForTimeout(500); await this.previousStep.click(); } async clickFinishInstallation() { - await this.commonPage.waitForElement(this.finishInstallation) + await this.page.waitForTimeout(500); await this.finishInstallation.click(); } async isFinishInstallationDisabled() { - await this.commonPage.waitForElement(this.finishInstallation) + await this.page.waitForTimeout(500); return await this.finishInstallation.isDisabled() } async isFinishInstallationEnabled() { - await this.commonPage.waitForElement(this.finishInstallation) + await this.page.waitForTimeout(500); return await this.finishInstallation.isEnabled() } async open_monacoEditor() { - await this.commonPage.waitForElement(this.viewEditYaml) + await this.page.waitForTimeout(500); this.viewEditYaml.click({ timeout: 2000 }) - await this.commonPage.waitForElement(this.editorTitleElement) + await this.page.waitForTimeout(500); const editor_title = await this.editorTitleElement.textContent(); return editor_title; } async clickCloseEditor() { - await this.commonPage.waitForElement(this.closeEditorButton) + await this.page.waitForTimeout(500); await this.closeEditorButton.click(); } - } export default ReviewPage; diff --git a/playwright_test/Pages/stcs.page.ts b/playwright_test/Pages/stcs.page.ts index 5083a6e1..d93eec1b 100644 --- a/playwright_test/Pages/stcs.page.ts +++ b/playwright_test/Pages/stcs.page.ts @@ -1,5 +1,4 @@ import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; class StcsPage { page: Page; @@ -10,10 +9,9 @@ class StcsPage { this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") } - commonPage = new CommonPage(); async getStcsPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) + await this.page.waitForTimeout(500); return await this.pageTitle.textContent({ timeout: 2000 }); } } diff --git a/playwright_test/Pages/vsam.page.ts b/playwright_test/Pages/vsam.page.ts index 23d060ee..543ea86d 100644 --- a/playwright_test/Pages/vsam.page.ts +++ b/playwright_test/Pages/vsam.page.ts @@ -1,5 +1,4 @@ import { Page, Locator } from '@playwright/test'; -import CommonPage from './common.page'; class VsamPage { page: Page; @@ -9,11 +8,8 @@ class VsamPage { this.page = page; this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div") } - - commonPage = new CommonPage(); - async getVsamPageTitle() { - await this.commonPage.waitForElement(this.pageTitle) + await this.page.waitForTimeout(500); return await this.pageTitle.textContent({ timeout: 2000 }); } } diff --git a/playwright_test/Tests/Review.spec.ts b/playwright_test/Tests/Review.spec.ts index 133ed29a..7d197bb0 100644 --- a/playwright_test/Tests/Review.spec.ts +++ b/playwright_test/Tests/Review.spec.ts @@ -53,7 +53,7 @@ test.describe('ReviewTab', () => { } }); - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({ page }) => { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) page = await electronApp.firstWindow() @@ -71,25 +71,10 @@ test.describe('ReviewTab', () => { launchConfigPage = new LaunchConfigPage(page); reviewPage = new ReviewPage(page); titlePage.navigateToConnectionTab() - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); await connectionPage.clickContinueButton(); - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - config.ZOWE_WORKSPACE_DIR, - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - config.JAVA_HOME, - config.NODE_HOME, - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await planningPage.clickValidateLocations() - await planningPage.clickContinueToInstallation() - await installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - await installationTypePage.continueToUnpax() - await installationTypePage.skipUnpax() - await page.waitForTimeout(5000); + await page.waitForTimeout(2000); reviewPage.clickReviewInstallationTab(); await page.waitForTimeout(5000); }) @@ -197,8 +182,8 @@ test.describe('ReviewTab', () => { test('Test Successful and Pending Operations Tabs', async ({ page }) => { expect(reviewPage.connectionTabSuccessfulIcon).toBeTruthy() - expect(reviewPage.planningTabSuccessfulIcon).toBeTruthy() - expect(reviewPage.installationTypeTabSuccessfulIcon).toBeTruthy() + expect(reviewPage.planningTabPendingIcon).toBeTruthy() + expect(reviewPage.installationTypeTabPendingIcon).toBeTruthy() expect(reviewPage.installationTabPendingIcon).toBeTruthy() expect(reviewPage.networkingTabPendingIcon).toBeTruthy() expect(reviewPage.apfAuthTabPendingIcon).toBeTruthy() @@ -224,6 +209,18 @@ test.describe('ReviewTab', () => { await page.waitForTimeout(2000); }) + test('Test If you can edit the Yaml', async ({ page }) => { + reviewPage.clickViewEditYaml() + await page.waitForTimeout(2000); + expect(reviewPage.editorTitleElement).toBeTruthy(); + try { + await reviewPage.readOnlyEditor.fill('Trying to update content'); + } catch (error) { + expect(error.message).toContain('Element is not an ,