From 0fc1a1d070fd21196bfe770eef757806b7da6d77 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Thu, 23 May 2024 00:59:32 +0530 Subject: [PATCH 1/6] Added State Management Tests Signed-off-by: sagar-1310 --- playwright_test/Pages/planning.page.ts | 7 ++ playwright_test/Tests/Planning.spec.ts | 2 +- .../Tests/StateManagementPlanning.spec.ts | 111 ++++++++++++++++++ 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 playwright_test/Tests/StateManagementPlanning.spec.ts diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 63b8c87e..7638fa12 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; @@ -71,6 +72,11 @@ class PlanningPage{ return await this.planningPageTitle.textContent(); } + async getJobStatement(){ + await this.page.waitForTimeout(1000); + return await this.jobStatement.textContent(); + } + async click_saveAndClose(){ this.save_and_close.click({ timeout: 2000 }) } @@ -239,6 +245,7 @@ class PlanningPage{ 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){ await this.page.waitForTimeout(2000); await this.clickSaveValidate(); + await this.page.waitForTimeout(30000); await this.enterRuntimeDir(runtimeDir); await this.enterWorkspaceDir(workspaceDir); await this.enterLogsDir(logDir); diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 61ed9f54..ccbe638d 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -149,7 +149,7 @@ test.describe('PlanningTab', () => { await page.waitForTimeout(2000); planningPage.enterZosmfPort(ZOSMF_PORT); await page.waitForTimeout(2000); - planningPage.enterZosmfApplicationId(ZOSMF_APPID); + planningPage.enterZosmfApplicationId(ZOSMF_APP_ID); await page.waitForTimeout(2000); planningPage.clickValidateLocations(); await page.waitForTimeout(20000); diff --git a/playwright_test/Tests/StateManagementPlanning.spec.ts b/playwright_test/Tests/StateManagementPlanning.spec.ts new file mode 100644 index 00000000..cd65382b --- /dev/null +++ b/playwright_test/Tests/StateManagementPlanning.spec.ts @@ -0,0 +1,111 @@ +import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; +import ConnectionPage from '../Pages/connection.page.ts'; +import TitlePage from '../Pages/title.page.ts'; +import PlanningPage from '../Pages/planning.page.ts'; +let page: Page; + +let electronApp: ElectronApplication +const SSH_HOST = process.env.SSH_HOST; +const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PORT = process.env.SSH_PORT; +const SSH_USER = process.env.SSH_USER; +const JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A" +const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; +const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; +const WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const LOG_DIR = process.env.ZOWE_LOG_DIR; +const EXTENSIONS_DIR = process.env.ZOWE_EXTENSION_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST=process.env.ZOSMF_HOST; +const ZOSMF_PORT=process.env.ZOSMF_PORT; +const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; + +test.describe('State_Management_PlanningTab', () => { + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let planningPage: PlanningPage; + + async function launch_Zen_and_Navigate_to_Planning_Tab({ 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); + await page.waitForTimeout(5000) + titlePage.navigateToConnectionTab(); + connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.SubmitValidateCredential(); + await page.waitForTimeout(3000); + connectionPage.clickContinueButton(); + await page.waitForTimeout(5000); + } + + test.beforeEach(async () => { + await launch_Zen_and_Navigate_to_Planning_Tab({page}) + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test Added Job Statement and Not Validated', async ({page}) => { + planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await page.waitForTimeout(5000) + const jobstatement = await planningPage.getJobStatement(); + expect(jobstatement).toBe(INVALID_JOB_STATEMENT); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + await electronApp.close() + await launch_Zen_and_Navigate_to_Planning_Tab({page}) + expect(jobstatement).toBe(INVALID_JOB_STATEMENT); + expect(isGreen_check_visible).toBe(false); + }) + + test('Test Added Job Statement and Validated Successfully', async ({page}) => { + planningPage.enterJobStatement(JOB_STATEMENT); + planningPage.clickSaveAndValidate(); + await page.waitForTimeout(30000); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Planning_Tab({page}) + expect(isGreen_check_visible).toBe(true); + }) + + test('Test Locations Validated and Planning Step Completed', async ({page}) => { + await page.waitForTimeout(5000) + planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + await page.waitForTimeout(30000); + planningPage.clickValidateLocations() + await page.waitForTimeout(30000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Planning_Tab({page}) + expect(is_GreenCheck_Visible).toBe(true); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Locations Not Validated and Planning Step Pending', async ({page}) => { + await page.waitForTimeout(5000) + planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + await page.waitForTimeout(30000); + planningPage.clickValidateLocations() + await page.waitForTimeout(30000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(false); + await electronApp.close() + await launch_Zen_and_Navigate_to_Planning_Tab({page}) + expect(is_GreenCheck_Visible).toBe(false); + expect(is_Continue_Button_enable).toBe(false); + }) +}) From 0062b7048470bc385d7bca0a3ab00dbf15c1b08f Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 24 May 2024 19:38:37 +0530 Subject: [PATCH 2/6] Added tests for Installation Type State Management Signed-off-by: sagar-1310 --- .../Pages/installationType.page.ts | 22 +++ playwright_test/Pages/planning.page.ts | 2 - .../StateManagementInstallationType.spec.ts | 135 ++++++++++++++++++ .../Tests/StateManagementPlanning.spec.ts | 8 +- 4 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 playwright_test/Tests/StateManagementInstallationType.spec.ts diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index b451ce2c..cf823b5b 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -17,6 +17,7 @@ class InstallationTypePage{ validateLocation: Locator; validateLocationGreenCheck: Locator; licenseAgreementGreenCheck: Locator; + disagreeLicense: Locator; constructor(page: Page) { @@ -31,6 +32,7 @@ class InstallationTypePage{ this.continueToComponentInstallation = page.locator("//button[text()='Continue to Components Installation']") this.zoweLink = page.locator("//a[@href='zowe.org']") this.agreeLicense = page.locator("//button[text()='Agree']") + this.disagreeLicense = page.locator("//button[text()='Agree']") this.uploadPaxButton = page.locator("//button[text()='Upload PAX']") this.runtimeDir = page.locator("//label[contains(text(),'Runtime Directory')]//following-sibling::div/input") this.validateLocation = page.locator("//button[text()= 'Validate location']") @@ -48,16 +50,31 @@ class InstallationTypePage{ await this.downloadPax.click({timeout: 5000}) } + async isDownloadZowePaxSelected(){ + await this.page.waitForTimeout(1000) + return await this.downloadPax.isChecked() + } + async selectUploadZowePax(){ await this.page.waitForTimeout(2000) await this.uploadPax.click({timeout: 5000}); } + async isUploadZowePaxSelected(){ + await this.page.waitForTimeout(1000) + return await this.uploadPax.isChecked() + } + async selectSmpe(){ await this.page.waitForTimeout(1000) await this.smpe.click({timeout: 5000}); } + async isSmpeSelected(){ + await this.page.waitForTimeout(1000) + return await this.smpe.isChecked() + } + async clickZoweLink(){ await this.page.waitForTimeout(1000) await this.zoweLink.click(); @@ -101,6 +118,11 @@ class InstallationTypePage{ await this.agreeLicense.click({timeout: 5000}); } + async clickDisagreeLicense(){ + await this.page.waitForTimeout(1000) + await this.disagreeLicense.click({timeout: 5000}); + } + async isLicenseAgreementGreenCheckVisible(){ await this.page.waitForTimeout(1000) return await this.licenseAgreementGreenCheck.isVisible(); diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 7638fa12..a6185263 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -244,8 +244,6 @@ class PlanningPage{ } 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){ await this.page.waitForTimeout(2000); - await this.clickSaveValidate(); - await this.page.waitForTimeout(30000); await this.enterRuntimeDir(runtimeDir); await this.enterWorkspaceDir(workspaceDir); await this.enterLogsDir(logDir); diff --git a/playwright_test/Tests/StateManagementInstallationType.spec.ts b/playwright_test/Tests/StateManagementInstallationType.spec.ts new file mode 100644 index 00000000..8d26a5d2 --- /dev/null +++ b/playwright_test/Tests/StateManagementInstallationType.spec.ts @@ -0,0 +1,135 @@ +import { test, ElectronApplication, expect, _electron as electron, Page } 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'; +let page: Page; + +let electronApp: ElectronApplication +const PLANNING_TITLE = 'Before you start'; +const INSTALLATION_PAGE_TITLE = 'Installation'; +const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; +const SSH_HOST = process.env.SSH_HOST; +const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PORT = process.env.SSH_PORT; +const SSH_USER = process.env.SSH_USER; +const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME= process.env.JOB_NAME; +const JOB_PREFIX=process.env.JOB_PREFIX; +const JAVA_HOME=process.env.JAVA_HOME; +const NODE_HOME=process.env.NODE_HOME; +const ZOSMF_HOST=process.env.ZOSMF_HOST; +const ZOSMF_PORT=process.env.ZOSMF_PORT; +const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const UPLOAD_PAX_PATH= process.env.ZOWE_ROOT_DIR + +test.describe('InstallationTypeTab', () => { + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let installationTypePage : InstallationTypePage; + let planningPage : PlanningPage; + + async function launch_Zen_and_Navigate_to_Installation_Type_Tab({ 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); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + await page.waitForTimeout(2000); + connectionPage.SubmitValidateCredential() + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + await page.waitForTimeout(2000); + planningPage.clickSaveValidate(); + await page.waitForTimeout(20000); + planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + await page.waitForTimeout(20000); + planningPage.clickValidateLocations() + await page.waitForTimeout(20000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + } + + test.beforeEach(async () => { + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test Select Downlad Zowe Pax', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); + expect(is_Download_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(is_Download_Zowe_Pax_Selected).toBe(true); + }) + + test('Test Select Upload Zowe Pax', async ({ page }) => { + installationTypePage.selectUploadZowePax() + const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); + expect(is_Upload_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(is_Upload_Zowe_Pax_Selected).toBe(true); + }) + + test('Test Select SMPE', async ({ page }) => { + installationTypePage.selectSmpe(); + const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); + expect(is_SMPE_Selected).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(is_SMPE_Selected).toBe(true); + expect(Is_Continue_Button_Enable).toBe(true); + }) + + test('Test Agree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickAgreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(is_GreenCheck_Visible).toBe(true); + expect(Is_Continue_Button_Enable).toBe(true); + }) + + test('Test Disagree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickDisagreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + expect(Is_Continue_Button_Enable).toBe(false); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(is_GreenCheck_Visible).toBe(false); + expect(Is_Continue_Button_Enable).toBe(false); + }) + + test('Test Upload Zowe Pax', async ({ page }) => { + await page.waitForTimeout(5000) + installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) + const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + expect(Is_Continue_Button_Enable).toBe(true); + }) + +}) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementPlanning.spec.ts b/playwright_test/Tests/StateManagementPlanning.spec.ts index cd65382b..b6bff4e5 100644 --- a/playwright_test/Tests/StateManagementPlanning.spec.ts +++ b/playwright_test/Tests/StateManagementPlanning.spec.ts @@ -78,7 +78,9 @@ test.describe('State_Management_PlanningTab', () => { }) test('Test Locations Validated and Planning Step Completed', async ({page}) => { - await page.waitForTimeout(5000) + await page.waitForTimeout(2000); + planningPage.clickSaveValidate(); + await page.waitForTimeout(20000); planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) await page.waitForTimeout(30000); planningPage.clickValidateLocations() @@ -94,7 +96,9 @@ test.describe('State_Management_PlanningTab', () => { }) test('Test Locations Not Validated and Planning Step Pending', async ({page}) => { - await page.waitForTimeout(5000) + await page.waitForTimeout(2000) + planningPage.clickSaveValidate(); + await page.waitForTimeout(20000); planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) await page.waitForTimeout(30000); planningPage.clickValidateLocations() From c75dc594e17b038f4824cfb42888bce0691892a6 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Tue, 28 May 2024 18:51:29 +0530 Subject: [PATCH 3/6] Added State Management tests for Installation, Apf Auth, and Security tabs Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 23 ++- playwright_test/Pages/installation.page.ts | 2 +- playwright_test/Pages/networking.page.ts | 11 +- playwright_test/Pages/security.page.ts | 14 +- .../StateManagementApfAuthSecurity.spec.ts | 170 ++++++++++++++++++ .../StateManagementInstallationType.spec.ts | 123 ++++++++++++- 6 files changed, 320 insertions(+), 23 deletions(-) create mode 100644 playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 92d3e5f6..0d7e88a1 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -13,7 +13,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; @@ -40,12 +39,7 @@ class ApfAuthPage{ auth_load_lib_value:Locator; auth_plugin_lib_value:Locator; dataset_prefix_value:Locator; - - - - - - + apf_auth_tab: Locator; constructor(page: Page) { this.page = page; @@ -83,6 +77,7 @@ 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.apf_auth_tab = page.locator("//span[text()='APF Auth']") } async returnTitleOfApfAuthPage(){ @@ -93,7 +88,12 @@ class ApfAuthPage{ async movetoApfAuthPage(){ await this.click_ApfAuth.click({timeout: 9000}) } - async movetoInstallationPage(){ + + async clickApfAuthTab(){ + await this.apf_auth_tab.click({timeout: 9000}) + } + + async movetoInstallationPage(){ await this.licenseAgreement.click({timeout: 9000}) await this.acceptLicense.click({timeout: 9000}) await this.continueToComponentInstallation.click({timeout: 5000}) @@ -153,9 +153,14 @@ class ApfAuthPage{ return editor_title; } - async isContinueButtonDisable(){ + async isContinueButtonEnabled(){ + return await this.continue_security_setup.isEnabled({ timeout: 5000 }); + } + + async isContinueButtonDisable(){ return await this.continue_security_setup.isDisabled({ timeout: 5000 }); } + async click_saveAndClose(){ this.save_and_close.click({ timeout: 2000 }) } diff --git a/playwright_test/Pages/installation.page.ts b/playwright_test/Pages/installation.page.ts index e4752476..f0691bd1 100644 --- a/playwright_test/Pages/installation.page.ts +++ b/playwright_test/Pages/installation.page.ts @@ -37,7 +37,7 @@ class InstallationPage{ 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.saveAndClose = page.locator("//button[text()='Save & close']") this.previousStep = page.locator("//button[text()='Previous step']") this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") this.continueToNetworkSetup = page.locator("//button[text()='Continue to Network Setup']") diff --git a/playwright_test/Pages/networking.page.ts b/playwright_test/Pages/networking.page.ts index eaff91ef..03fd4f9e 100644 --- a/playwright_test/Pages/networking.page.ts +++ b/playwright_test/Pages/networking.page.ts @@ -21,8 +21,7 @@ class NetworkingPage{ close_button:Locator; CONFPAGE_TITLE: Locator; continueToComponentInstallation: Locator; - - + contiuneToApfAuth: Locator; constructor(page: Page) { this.page = page; @@ -101,7 +100,7 @@ class NetworkingPage{ this.close_button = page.locator('//button[contains(text(), "Close")]'); this.APFAUTH_TITLE = page.locator('//div[text()="APF Authorize Load Libraries"]'); this.continue_ReviewSelector = page.locator('//button[contains(text(), "Continue to APF Auth Setup")]'); - this.installationTitle = page.locator('//div[text()="Installation"]'); + this.contiuneToApfAuth = page.locator('//button[text()="Continue to APF Auth Setup"]'); } async movetoNetworkingPage(){ @@ -193,6 +192,7 @@ class NetworkingPage{ async delete_DomainNameField(){ await this.deleteDomainName.click(); } + async add_DomainNameField(){ await this.addDomainField.click() } @@ -211,7 +211,10 @@ class NetworkingPage{ async is_skipNetworkingButtonEnable(){ return await this.skip_button.isEnabled({ timeout: 5000 }); } - + async clickContinueToApfAuth(){ + this.contiuneToApfAuth.click({ timeout: 2000 }) + } + async click_skipNetworking(){ await this.skip_button.click({ timeout: 2000 }); const apfAuth_title = await this.APFAUTH_TITLE.textContent(); diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index 621fd5cb..55dbc9ef 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -30,8 +30,7 @@ class SecurityPage{ product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; - - + security_tab: Locator; constructor(page: Page) { this.page = page; @@ -59,7 +58,6 @@ class SecurityPage{ this.certificateTab_title = page.locator('//div[text()="Certificates"]') this.securityTab_title = page.locator('//div[text()="Security"]') this.continue_CertificateSelector = page.locator('//button[contains(text(), "Continue to Certificates Setup")]') - this.admin = page.getByLabel('Admin'); this.stc = page.getByLabel('Stc'); this.sys_prog = page.getByLabel('Sys Prog'); @@ -68,7 +66,7 @@ class SecurityPage{ 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.security_tab = page.locator("//span[text()='Security']") } async movetoSecurityPage(){ @@ -96,6 +94,10 @@ class SecurityPage{ await this.stc_zis.fill(stc_zis,{ timeout: 10000 }) } + async clickSecurityTab(){ + await this.security_tab.click({ timeout: 2000 }) + } + async fillAdmin(admin:string){ await this.admin.fill(admin,{ timeout: 10000 }) } @@ -151,6 +153,10 @@ class SecurityPage{ return editor_title; } + async isContinueButtonEnabled(){ + return await this.continue_CertificateSelector.isEnabled({ timeout: 5000 }); + } + async isContinueButtonDisable(){ return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } diff --git a/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts b/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts new file mode 100644 index 00000000..ffb3544a --- /dev/null +++ b/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts @@ -0,0 +1,170 @@ +import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; +import ApfAuthPage from '../Pages/ApfAuth.page.js'; +import TitlePage from '../Pages/title.page.js'; +import ConnectionPage from '../Pages/connection.page.js'; +import PlanningPage from '../Pages/planning.page.js'; +import InstallationTypePage from '../Pages/installationType.page.js'; +import InstallationPage from '../Pages/installation.page.js'; +import NetworkingPage from '../Pages/networking.page.js'; +import SecurityPage from '../Pages/security.page'; +let page: Page; + +let electronApp: ElectronApplication +const DATASET_PREFIX = 'IBMUSER.ZWEV1' +const AUTH_LOAD_LIB = 'IBMUSER.ZWEV1.ZWEAUTH' +const AUTH_PLUGIN_LIB = 'IBMUSER.ZWEV1.CUST.ZWESAPL' +const SSH_HOST = process.env.SSH_HOST; +const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PORT = process.env.SSH_PORT; +const SSH_USER = process.env.SSH_USER; +const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; +const RUNTIME_DIR=process.env.ZOWE_ROOT_DIR; +const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME= process.env.JOB_NAME; +const JOB_PREFIX=process.env.JOB_PREFIX; +const JAVA_HOME=process.env.JAVA_HOME; +const NODE_HOME=process.env.NODE_HOME; +const ZOSMF_HOST=process.env.ZOSMF_HOST; +const ZOSMF_PORT=process.env.ZOSMF_PORT; +const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const SECURITY_ADMIN= process.env.SECURITY_ADMIN; +const SECURITY_STC = process.env.SECURITY_STC; +const SECURITY_SYSPROG = process.env.SECURITY_SYSPROG; +const SECURITY_USER_ZIS = process.env.SECURITY_USER_ZIS; +const SECURITY_USER_ZOWE = process.env.SECURITY_USER_ZOWE; +const SECURITY_AUX = process.env.SECURITY_AUX; +const SECURITY_STC_ZOWE = process.env.SECURITY_STC_ZOWE; +const SECURITY_STC_ZIS = process.env.SECURITY_STC_ZIS; + +test.describe('ApfAuthTab', () => { + let connectionPage: ConnectionPage; + let titlePage : TitlePage; + let apfAuthPage : ApfAuthPage; + let planningPage : PlanningPage; + let installationTypePage : InstallationTypePage; + let installationPage : InstallationPage; + let networkingPage : NetworkingPage + let securityPage : SecurityPage; + + async function launch_Zen_and_Navigate_to_Installation_Tab({ 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); + installationTypePage = new InstallationTypePage(page); + installationPage = new InstallationPage(page); + networkingPage = new NetworkingPage(page); + apfAuthPage = new ApfAuthPage(page); + securityPage = new SecurityPage(page); + await page.waitForTimeout(5000) + titlePage.navigateToConnectionTab(); + connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.SubmitValidateCredential(); + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + await page.waitForTimeout(2000); + planningPage.clickSaveValidate(); + await page.waitForTimeout(20000); + planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + await page.waitForTimeout(20000); + planningPage.clickValidateLocations() + await page.waitForTimeout(20000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + installationTypePage.clickContinueToInstallation() + } + + test.beforeEach(async () => { + await launch_Zen_and_Navigate_to_Installation_Tab({page}) + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test Apf Auth Completed', async ({ page }) => { + await page.waitForTimeout(2000); + apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + installationPage.clickSkipInstallation() + await page.waitForTimeout(2000); + networkingPage.clickContinueToApfAuth() + await page.waitForTimeout(2000); + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitApf_check_visible = await apfAuthPage.isInitApfGreenCheckVisible(); + expect(isInitApf_check_visible).toBe(true); + const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); + expect(isContinueSecurityButtonEnabled).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Tab({page}) + apfAuthPage.clickApfAuthTab() + await page.waitForTimeout(2000); + expect(isWriteConfig_check_visible).toBe(true); + expect(isUploadConfig_check_visible).toBe(true); + expect(isInitApf_check_visible).toBe(true); + expect(isContinueSecurityButtonEnabled).toBe(true); + }) + + test('Test Apf Auth Pending', async ({ page }) => { + await page.waitForTimeout(2000); + apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + installationPage.clickSkipInstallation() + await page.waitForTimeout(2000); + const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); + expect(isContinueSecurityButtonEnabled).toBe(false); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Tab({page}) + apfAuthPage.clickApfAuthTab() + await page.waitForTimeout(2000); + expect(isContinueSecurityButtonEnabled).toBe(false); + }) + + test('Test Security Setup Completed', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) + await page.waitForTimeout(5000); + securityPage.initializeSecurity() + await page.waitForTimeout(5000); + const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); + expect(isInitSecurity_check_visible).toBe(true); + const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); + expect(isContinueCertificatesButtonEnabled).toBe(true); + await page.waitForTimeout(2000); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Tab({page}) + securityPage.clickSecurityTab() + await page.waitForTimeout(2000); + expect(isWriteConfig_check_visible).toBe(true); + expect(isUploadConfig_check_visible).toBe(true); + expect(isInitSecurity_check_visible).toBe(true); + expect(isContinueCertificatesButtonEnabled).toBe(true); + }) + + test('Test Security Setup Pending', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) + await page.waitForTimeout(5000); + const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); + expect(isContinueCertificatesButtonEnabled).toBe(false); + await page.waitForTimeout(2000); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Tab({page}) + securityPage.clickSecurityTab() + await page.waitForTimeout(2000); + expect(isContinueCertificatesButtonEnabled).toBe(false); + }) + +}) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementInstallationType.spec.ts b/playwright_test/Tests/StateManagementInstallationType.spec.ts index 8d26a5d2..414dde3d 100644 --- a/playwright_test/Tests/StateManagementInstallationType.spec.ts +++ b/playwright_test/Tests/StateManagementInstallationType.spec.ts @@ -3,11 +3,11 @@ 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'; let page: Page; let electronApp: ElectronApplication -const PLANNING_TITLE = 'Before you start'; -const INSTALLATION_PAGE_TITLE = 'Installation'; const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; const SSH_PASSWD = process.env.SSH_PASSWD; @@ -24,12 +24,23 @@ const ZOSMF_HOST=process.env.ZOSMF_HOST; const ZOSMF_PORT=process.env.ZOSMF_PORT; const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; const UPLOAD_PAX_PATH= process.env.ZOWE_ROOT_DIR +const NETWORKING_PAGE_TITLE = 'Networking' +const DATASET_PREFIX= process.env.DATASET_PREFIX; +const PROC_LIB = process.env.PROC_LIB; +const PARM_LIB = process.env.PARM_LIB; +const ZIS = process.env.SECURITY_STC_ZIS; +const JCL_LIB = process.env.JCL_LIB; +const LOAD_LIB = process.env.LOAD_LIB; +const AUTH_LOAD_LIB = process.env.AUTH_LOAD_LIB; +const AUTH_PLUGIN_LIB = process.env.AUTH_PLUGIN_LIB; test.describe('InstallationTypeTab', () => { let connectionPage: ConnectionPage; let titlePage : TitlePage; let installationTypePage : InstallationTypePage; let planningPage : PlanningPage; + let installationPage : InstallationPage; + let networkingPage : NetworkingPage async function launch_Zen_and_Navigate_to_Installation_Type_Tab({ page }) { test.setTimeout(900000); @@ -39,10 +50,13 @@ test.describe('InstallationTypeTab', () => { titlePage = new TitlePage(page); planningPage = new PlanningPage(page); installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab() + installationPage = new InstallationPage(page); + networkingPage = new NetworkingPage(page); + await page.waitForTimeout(5000) + titlePage.navigateToConnectionTab(); connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(2000); - connectionPage.SubmitValidateCredential() + await page.waitForTimeout(5000); + connectionPage.SubmitValidateCredential(); await page.waitForTimeout(5000); connectionPage.clickContinueButton() await page.waitForTimeout(2000); @@ -132,4 +146,103 @@ test.describe('InstallationTypeTab', () => { expect(Is_Continue_Button_Enable).toBe(true); }) + test('Test Installation Completed with Download Pax', async ({ page }) => { + await page.waitForTimeout(5000); + installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(5000); + installationPage.enterPrefix(DATASET_PREFIX) + installationPage.enterProcLib(PROC_LIB) + installationPage.enterParmLib(PARM_LIB) + installationPage.enterZis(ZIS) + installationPage.enterJclLib(JCL_LIB) + installationPage.enterLoadLib(LOAD_LIB) + installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) + installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) + installationPage.clickInstallMvsDatasets(); + await page.waitForTimeout(1800000); + const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); + expect(is_Continue_Button_enable).toBe(true); + installationPage.clickContinueToNetworkSetup(); + await page.waitForTimeout(2000); + const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() + expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(2000); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Installation Completed with Upload Pax', async ({ page }) => { + await page.waitForTimeout(5000); + installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(5000); + installationPage.enterPrefix(DATASET_PREFIX) + installationPage.enterProcLib(PROC_LIB) + installationPage.enterParmLib(PARM_LIB) + installationPage.enterZis(ZIS) + installationPage.enterJclLib(JCL_LIB) + installationPage.enterLoadLib(LOAD_LIB) + installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) + installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) + installationPage.clickInstallMvsDatasets(); + await page.waitForTimeout(1800000); + const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); + expect(is_Continue_Button_enable).toBe(true); + installationPage.clickContinueToNetworkSetup(); + await page.waitForTimeout(2000); + const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() + expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(2000); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Installation Pending with Download Pax', async ({ page }) => { + await page.waitForTimeout(5000); + installationTypePage.downloadZowePaxAndNavigateToInstallationPage() + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(5000); + installationPage.enterPrefix(DATASET_PREFIX) + installationPage.enterProcLib(PROC_LIB) + installationPage.enterParmLib(PARM_LIB) + installationPage.enterZis(ZIS) + installationPage.enterJclLib(JCL_LIB) + installationPage.enterLoadLib(LOAD_LIB) + installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) + installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) + const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); + expect(is_Continue_Button_disable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(2000); + expect(is_Continue_Button_disable).toBe(true); + }) + + test('Test Installation Pending with Upload Pax', async ({ page }) => { + await page.waitForTimeout(5000); + installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(5000); + installationPage.enterPrefix(DATASET_PREFIX) + installationPage.enterProcLib(PROC_LIB) + installationPage.enterParmLib(PARM_LIB) + installationPage.enterZis(ZIS) + installationPage.enterJclLib(JCL_LIB) + installationPage.enterLoadLib(LOAD_LIB) + installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) + installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) + const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); + expect(is_Continue_Button_disable).toBe(true); + await electronApp.close() + await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + installationTypePage.clickContinueToInstallation() + await page.waitForTimeout(2000); + expect(is_Continue_Button_disable).toBe(true); + }) }) \ No newline at end of file From 05050317aa5e8b000ed89be9ae8f9e1648e89abc Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 15 Nov 2024 11:42:49 +0530 Subject: [PATCH 4/6] Added state management tests for Planning and Installation Type Tabs Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 27 +- playwright_test/Pages/connection.page.ts | 5 + .../Pages/installationType.page.ts | 18 +- playwright_test/Pages/planning.page.ts | 24 +- playwright_test/Pages/security.page.ts | 14 +- playwright_test/Tests/Planning.spec.ts | 8 +- .../StateManagementApfAuthSecurity.spec.ts | 170 ------------- .../StateManagementInstallationType.spec.ts | 235 +++++------------- .../Tests/StateManagementPlanning.spec.ts | 110 ++++---- playwright_test/utils/config.ts | 2 + 10 files changed, 197 insertions(+), 416 deletions(-) delete mode 100644 playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 8d7b51b0..0a0f20c1 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -13,6 +13,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; @@ -41,6 +42,11 @@ class ApfAuthPage{ dataset_prefix_value:Locator; apf_auth_tab: Locator; + + + + + constructor(page: Page) { this.page = page; this.continueButtonSelector = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') @@ -82,8 +88,13 @@ class ApfAuthPage{ //this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]') this.select_SMPE = page.locator('span:has-text("SMP/E")'); - + this.apf_auth_tab = page.locator("//span[text()='APF Auth']") } + + async clickApfAuthTab(){ + await this.apf_auth_tab.click({timeout: 9000}) + } + async returnTitleOfApfAuthPage(){ const ApfAuthTitle = await this.APFAUTH_TITLE.textContent(); return ApfAuthTitle; @@ -94,6 +105,13 @@ class ApfAuthPage{ await this.click_ApfAuth.click({timeout: 9000}) } + async movetoInstallationPage(){ + await this.page.waitForTimeout(5000) + await this.click_Installation.click({timeout: 9000}) + } + async isContinueButtonEnabled(){ + return await this.continue_security_setup.isEnabled(); + } async selectInstallationType(){ await this.select_SMPE.waitFor({ state: 'visible', timeout: 9000 }); // Adjust timeout if needed console.log('SMP/E span is visible.'); @@ -174,14 +192,9 @@ class ApfAuthPage{ return editor_title; } - async isContinueButtonEnabled(){ - return await this.continue_security_setup.isEnabled({ timeout: 5000 }); - } - - async isContinueButtonDisable(){ + async isContinueButtonDisable(){ return await this.continue_security_setup.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ this.save_and_close.click({ timeout: 2000 }) } diff --git a/playwright_test/Pages/connection.page.ts b/playwright_test/Pages/connection.page.ts index adf3a629..b7cd9098 100644 --- a/playwright_test/Pages/connection.page.ts +++ b/playwright_test/Pages/connection.page.ts @@ -57,6 +57,11 @@ class ConnectionPage{ return await this.connectionPageTitle.textContent(); } + async fillPassword(password: string){ + await this.page.waitForTimeout(2000); + await this.password.fill(password); + } + async SubmitValidateCredential(){ console.log("Submitting credentials..."); await this.validateCredential.click(); diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index 11e8442c..dae74577 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -18,7 +18,8 @@ class InstallationTypePage{ validateLocationGreenCheck: Locator; licenseAgreementGreenCheck: Locator; disagreeLicense: Locator; - + installation_Type_Tab: Locator; + continueToUnpaxButton: Locator; constructor(page: Page) { this.page = page; @@ -33,7 +34,7 @@ class InstallationTypePage{ this.continueToComponentInstallation = page.locator("//button[text()='Continue to Components Installation']") this.zoweLink = page.locator("//a[@href='zowe.org']") this.agreeLicense = page.locator("//button[text()='Agree']") - this.disagreeLicense = page.locator("//button[text()='Agree']") + this.disagreeLicense = page.locator("//button[text()='Disagree']") this.uploadPaxButton = page.locator("//button[text()='Upload PAX']") this.runtimeDir = page.locator("//label[contains(text(),'Runtime Directory')]//following-sibling::div/input") this.validateLocation = page.locator("//button[text()= 'Validate location']") @@ -42,12 +43,17 @@ class InstallationTypePage{ this.retrieveExampleZoweYaml = page.locator("//button[contains(text(),'Retrieve example-zowe.yaml')]") this.continueCompInstallation = page.locator("//button[contains(text(),'Continue to Components Installation')]") this.skipUnpaxButton = page.locator("//button[text()='Skip ']") - this.continueToUnpax = page.locator("//button[contains(text(),'Continue to Unpax')]") + this.continueToUnpaxButton = page.locator("//button[contains(text(),'Continue to Unpax')]") this.SkipUnpax = page.locator('//button[contains(text(),"Skip")]') this.retrieveExampleZoweYaml= page.locator('//button[contains(text(),"Retrieve example-zowe.yaml")]') this.click_InitializationStage = page.locator('//span[text()="Initialization"]') + this.installation_Type_Tab = page.locator('//span[text()="Installation Type"]') } + async clickInstallationTypeTab(){ + await this.installation_Type_Tab.click({timeout: 9000}) + } + async getInstallationTypePageTitle(){ return await this.pageTitle.textContent({ timeout: 2000 }); } @@ -200,7 +206,11 @@ class InstallationTypePage{ this.clickValidateLocation() } async clickOnContinueToUnpax(){ - this.continueToUnpax.click({ timeout: 2000 }) + this.continueToUnpaxButton.click({ timeout: 2000 }) + } + + async isContinueToUnpaxEnabled(){ + return await this.continueToUnpaxButton.isEnabled() } async clickSkipUnpaxButton(){ diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 6d14485f..091fe439 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -229,6 +229,23 @@ class PlanningPage{ await this.previousStep.click(); } + private async waitForContinueButtonToBeEnabled(): Promise { + const timeout = 100000; // Adjust the timeout as needed + const interval = 500; + const endTime = Date.now() + timeout; + + while (Date.now() < endTime) { + if (await this.isContinueToInstallationEnabled()) { + console.log("Continue button is enabled."); + return true; // Button became enabled + } + await this.page.waitForTimeout(interval); + } + + console.log("Continue button did not enabled "); + return false; // Button did not become enabled + } + async clickContinueToInstallation(){ const timeout = 30000; const interval = 100; @@ -271,7 +288,7 @@ class PlanningPage{ } - 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); @@ -279,11 +296,10 @@ class PlanningPage{ await this.enterExtensionsDir(extensionDir); 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); } - } export default PlanningPage; diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index 5161d299..017afa2c 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -30,7 +30,8 @@ class SecurityPage{ product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; - security_tab: Locator; + + constructor(page: Page) { this.page = page; @@ -66,9 +67,6 @@ class SecurityPage{ this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/label'); this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/label'); 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.security_tab = page.locator("//span[text()='Security']") this.stc_zowe = page.locator(this.stc_mainXpath + '/div[1]/div/div[1]/div/label'); this.stc_zis = page.locator(this.stc_mainXpath + '/div[1]/div/div[2]/div/label'); @@ -102,10 +100,6 @@ class SecurityPage{ } - async clickSecurityTab(){ - await this.security_tab.click({ timeout: 2000 }) - } - async fillAdmin(admin:string){ await this.admin.fill(admin,{ timeout: 10000 }) } @@ -179,10 +173,6 @@ class SecurityPage{ return editor_title; } - async isContinueButtonEnabled(){ - return await this.continue_CertificateSelector.isEnabled({ timeout: 5000 }); - } - async isContinueButtonDisable(){ return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 716561d9..5007d065 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -90,7 +90,7 @@ test.describe('PlanningTab', () => { }) test('Test Validate Locations with Valid Data', async () => { - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, config.ZOWE_WORKSPACE_DIR, config.ZOWE_EXTENSION_DIR, config.ZOWE_LOG_DIR, @@ -125,10 +125,10 @@ test.describe('PlanningTab', () => { const is_Continue_Button_enable = await planningPage.isContinueToInstallationDisabled(); expect(is_Continue_Button_enable).toBe(true); }) - + test('Test Save and Close and Resume Progress', async () => { - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, config.ZOWE_WORKSPACE_DIR, config.ZOWE_EXTENSION_DIR, config.ZOWE_LOG_DIR, @@ -139,7 +139,7 @@ test.describe('PlanningTab', () => { config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() - await planningPage.click_saveAndClose() + await planningPage.click_saveAndClose() await titlePage.clickOnResumeProgress(); await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); diff --git a/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts b/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts deleted file mode 100644 index ffb3544a..00000000 --- a/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import ApfAuthPage from '../Pages/ApfAuth.page.js'; -import TitlePage from '../Pages/title.page.js'; -import ConnectionPage from '../Pages/connection.page.js'; -import PlanningPage from '../Pages/planning.page.js'; -import InstallationTypePage from '../Pages/installationType.page.js'; -import InstallationPage from '../Pages/installation.page.js'; -import NetworkingPage from '../Pages/networking.page.js'; -import SecurityPage from '../Pages/security.page'; -let page: Page; - -let electronApp: ElectronApplication -const DATASET_PREFIX = 'IBMUSER.ZWEV1' -const AUTH_LOAD_LIB = 'IBMUSER.ZWEV1.ZWEAUTH' -const AUTH_PLUGIN_LIB = 'IBMUSER.ZWEV1.CUST.ZWESAPL' -const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; -const SSH_PORT = process.env.SSH_PORT; -const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const RUNTIME_DIR=process.env.ZOWE_ROOT_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; -const SECURITY_ADMIN= process.env.SECURITY_ADMIN; -const SECURITY_STC = process.env.SECURITY_STC; -const SECURITY_SYSPROG = process.env.SECURITY_SYSPROG; -const SECURITY_USER_ZIS = process.env.SECURITY_USER_ZIS; -const SECURITY_USER_ZOWE = process.env.SECURITY_USER_ZOWE; -const SECURITY_AUX = process.env.SECURITY_AUX; -const SECURITY_STC_ZOWE = process.env.SECURITY_STC_ZOWE; -const SECURITY_STC_ZIS = process.env.SECURITY_STC_ZIS; - -test.describe('ApfAuthTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let apfAuthPage : ApfAuthPage; - let planningPage : PlanningPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage - let securityPage : SecurityPage; - - async function launch_Zen_and_Navigate_to_Installation_Tab({ 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); - installationTypePage = new InstallationTypePage(page); - installationPage = new InstallationPage(page); - networkingPage = new NetworkingPage(page); - apfAuthPage = new ApfAuthPage(page); - securityPage = new SecurityPage(page); - await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - await page.waitForTimeout(2000); - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - } - - test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test Apf Auth Completed', async ({ page }) => { - await page.waitForTimeout(2000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - installationPage.clickSkipInstallation() - await page.waitForTimeout(2000); - networkingPage.clickContinueToApfAuth() - await page.waitForTimeout(2000); - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfigGreenCheckVisible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitApf_check_visible = await apfAuthPage.isInitApfGreenCheckVisible(); - expect(isInitApf_check_visible).toBe(true); - const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); - expect(isContinueSecurityButtonEnabled).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - apfAuthPage.clickApfAuthTab() - await page.waitForTimeout(2000); - expect(isWriteConfig_check_visible).toBe(true); - expect(isUploadConfig_check_visible).toBe(true); - expect(isInitApf_check_visible).toBe(true); - expect(isContinueSecurityButtonEnabled).toBe(true); - }) - - test('Test Apf Auth Pending', async ({ page }) => { - await page.waitForTimeout(2000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - installationPage.clickSkipInstallation() - await page.waitForTimeout(2000); - const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); - expect(isContinueSecurityButtonEnabled).toBe(false); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - apfAuthPage.clickApfAuthTab() - await page.waitForTimeout(2000); - expect(isContinueSecurityButtonEnabled).toBe(false); - }) - - test('Test Security Setup Completed', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) - await page.waitForTimeout(5000); - securityPage.initializeSecurity() - await page.waitForTimeout(5000); - const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); - expect(isInitSecurity_check_visible).toBe(true); - const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); - expect(isContinueCertificatesButtonEnabled).toBe(true); - await page.waitForTimeout(2000); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - securityPage.clickSecurityTab() - await page.waitForTimeout(2000); - expect(isWriteConfig_check_visible).toBe(true); - expect(isUploadConfig_check_visible).toBe(true); - expect(isInitSecurity_check_visible).toBe(true); - expect(isContinueCertificatesButtonEnabled).toBe(true); - }) - - test('Test Security Setup Pending', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) - await page.waitForTimeout(5000); - const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); - expect(isContinueCertificatesButtonEnabled).toBe(false); - await page.waitForTimeout(2000); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - securityPage.clickSecurityTab() - await page.waitForTimeout(2000); - expect(isContinueCertificatesButtonEnabled).toBe(false); - }) - -}) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementInstallationType.spec.ts b/playwright_test/Tests/StateManagementInstallationType.spec.ts index 414dde3d..2ed58ca1 100644 --- a/playwright_test/Tests/StateManagementInstallationType.spec.ts +++ b/playwright_test/Tests/StateManagementInstallationType.spec.ts @@ -1,79 +1,50 @@ import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import TitlePage from '../Pages/title.page.ts'; import ConnectionPage from '../Pages/connection.page.ts'; +import TitlePage from '../Pages/title.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 config from '../utils/config.ts'; let page: Page; let electronApp: ElectronApplication -const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; -const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; -const SSH_PORT = process.env.SSH_PORT; -const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; -const UPLOAD_PAX_PATH= process.env.ZOWE_ROOT_DIR -const NETWORKING_PAGE_TITLE = 'Networking' -const DATASET_PREFIX= process.env.DATASET_PREFIX; -const PROC_LIB = process.env.PROC_LIB; -const PARM_LIB = process.env.PARM_LIB; -const ZIS = process.env.SECURITY_STC_ZIS; -const JCL_LIB = process.env.JCL_LIB; -const LOAD_LIB = process.env.LOAD_LIB; -const AUTH_LOAD_LIB = process.env.AUTH_LOAD_LIB; -const AUTH_PLUGIN_LIB = process.env.AUTH_PLUGIN_LIB; test.describe('InstallationTypeTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage + let titlePage: TitlePage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage; - async function launch_Zen_and_Navigate_to_Installation_Type_Tab({ page }) { + async function launch_Zen({ page }) { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() + page = await electronApp.firstWindow() connectionPage = new ConnectionPage(page); titlePage = new TitlePage(page); planningPage = new PlanningPage(page); installationTypePage = new InstallationTypePage(page); - installationPage = new InstallationPage(page); - networkingPage = new NetworkingPage(page); await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - await page.waitForTimeout(2000); - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); } test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({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() }) - + test.afterEach(async () => { await electronApp.close() }) @@ -83,7 +54,13 @@ test.describe('InstallationTypeTab', () => { const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); expect(is_Download_Zowe_Pax_Selected).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_Download_Zowe_Pax_Selected).toBe(true); }) @@ -92,7 +69,13 @@ test.describe('InstallationTypeTab', () => { const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); expect(is_Upload_Zowe_Pax_Selected).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_Upload_Zowe_Pax_Selected).toBe(true); }) @@ -100,10 +83,16 @@ test.describe('InstallationTypeTab', () => { installationTypePage.selectSmpe(); const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); expect(is_SMPE_Selected).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_SMPE_Selected).toBe(true); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -114,10 +103,16 @@ test.describe('InstallationTypeTab', () => { installationTypePage.clickAgreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(true); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -128,121 +123,17 @@ test.describe('InstallationTypeTab', () => { installationTypePage.clickDisagreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(false); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); - expect(Is_Continue_Button_Enable).toBe(false); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - expect(is_GreenCheck_Visible).toBe(false); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(false); - }) - - test('Test Upload Zowe Pax', async ({ page }) => { - await page.waitForTimeout(5000) - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); - expect(Is_Continue_Button_Enable).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - expect(Is_Continue_Button_Enable).toBe(true); - }) - - test('Test Installation Completed with Download Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - installationPage.clickInstallMvsDatasets(); - await page.waitForTimeout(1800000); - const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); - expect(is_Continue_Button_enable).toBe(true); - installationPage.clickContinueToNetworkSetup(); - await page.waitForTimeout(2000); - const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(2000); - expect(is_Continue_Button_enable).toBe(true); - }) - - test('Test Installation Completed with Upload Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - installationPage.clickInstallMvsDatasets(); - await page.waitForTimeout(1800000); - const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); - expect(is_Continue_Button_enable).toBe(true); - installationPage.clickContinueToNetworkSetup(); - await page.waitForTimeout(2000); - const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(2000); - expect(is_Continue_Button_enable).toBe(true); - }) - - test('Test Installation Pending with Download Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); - expect(is_Continue_Button_disable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) await page.waitForTimeout(2000); - expect(is_Continue_Button_disable).toBe(true); - }) - - test('Test Installation Pending with Upload Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); - expect(is_Continue_Button_disable).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); await page.waitForTimeout(2000); - expect(is_Continue_Button_disable).toBe(true); + expect(is_GreenCheck_Visible).toBe(false); + expect(Is_Continue_Button_Enable).toBe(false); }) }) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementPlanning.spec.ts b/playwright_test/Tests/StateManagementPlanning.spec.ts index b6bff4e5..0a5e8987 100644 --- a/playwright_test/Tests/StateManagementPlanning.spec.ts +++ b/playwright_test/Tests/StateManagementPlanning.spec.ts @@ -2,33 +2,19 @@ import { test, ElectronApplication, expect, _electron as electron, Page } from ' import ConnectionPage from '../Pages/connection.page.ts'; import TitlePage from '../Pages/title.page.ts'; import PlanningPage from '../Pages/planning.page.ts'; +import config from '../utils/config.ts'; let page: Page; let electronApp: ElectronApplication -const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; -const SSH_PORT = process.env.SSH_PORT; -const SSH_USER = process.env.SSH_USER; -const JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A" +const VALID_JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A"; const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; -const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; -const WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; -const LOG_DIR = process.env.ZOWE_LOG_DIR; -const EXTENSIONS_DIR = process.env.ZOWE_EXTENSION_DIR; -const JOB_NAME = process.env.JOB_NAME; -const JOB_PREFIX = process.env.JOB_PREFIX; -const JAVA_HOME = process.env.JAVA_HOME; -const NODE_HOME = process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; test.describe('State_Management_PlanningTab', () => { let connectionPage: ConnectionPage; let titlePage : TitlePage; let planningPage: PlanningPage; - async function launch_Zen_and_Navigate_to_Planning_Tab({ page }) { + async function launch_Zen({ page }) { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) page= await electronApp.firstWindow() @@ -36,79 +22,117 @@ test.describe('State_Management_PlanningTab', () => { titlePage = new TitlePage(page); planningPage = new PlanningPage(page); await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - await page.waitForTimeout(3000); - connectionPage.clickContinueButton(); - await page.waitForTimeout(5000); } test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.navigateToConnectionTab(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); }) - + test.afterEach(async () => { await electronApp.close() }) test('Test Added Job Statement and Not Validated', async ({page}) => { planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await page.waitForTimeout(2000) + planningPage.clickSaveAndValidate(); await page.waitForTimeout(5000) const jobstatement = await planningPage.getJobStatement(); expect(jobstatement).toBe(INVALID_JOB_STATEMENT); const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); expect(isGreen_check_visible).toBe(false); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(jobstatement).toBe(INVALID_JOB_STATEMENT); expect(isGreen_check_visible).toBe(false); }) - + test('Test Added Job Statement and Validated Successfully', async ({page}) => { - planningPage.enterJobStatement(JOB_STATEMENT); + planningPage.enterJobStatement(VALID_JOB_STATEMENT); + await page.waitForTimeout(2000) planningPage.clickSaveAndValidate(); - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); expect(isGreen_check_visible).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(isGreen_check_visible).toBe(true); }) test('Test Locations Validated and Planning Step Completed', async ({page}) => { await page.waitForTimeout(2000); - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(30000); + 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 page.waitForTimeout(2000); planningPage.clickValidateLocations() - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); expect(is_Continue_Button_enable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(true); expect(is_Continue_Button_enable).toBe(true); }) test('Test Locations Not Validated and Planning Step Pending', async ({page}) => { await page.waitForTimeout(2000) - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(30000); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + 'TESTABC', + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + 'JAVA_HOME', + '12345', + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await page.waitForTimeout(2000) planningPage.clickValidateLocations() - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(false); const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); expect(is_Continue_Button_enable).toBe(false); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(false); expect(is_Continue_Button_enable).toBe(false); }) diff --git a/playwright_test/utils/config.ts b/playwright_test/utils/config.ts index 95e14579..5c9d65bf 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; @@ -58,6 +59,7 @@ const config: Config = { 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 4e75acc3c08aa9fef948836767425260a66470dc Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Fri, 15 Nov 2024 13:07:52 +0530 Subject: [PATCH 5/6] Reverted unwanted files to base Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 15 ++++------- playwright_test/Pages/networking.page.ts | 32 +++++++++++------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 0a0f20c1..6a0b2713 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -40,7 +40,7 @@ class ApfAuthPage{ auth_load_lib_value:Locator; auth_plugin_lib_value:Locator; dataset_prefix_value:Locator; - apf_auth_tab: Locator; + @@ -85,16 +85,11 @@ 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")'); - this.apf_auth_tab = page.locator("//span[text()='APF Auth']") - } - - async clickApfAuthTab(){ - await this.apf_auth_tab.click({timeout: 9000}) - } + } async returnTitleOfApfAuthPage(){ const ApfAuthTitle = await this.APFAUTH_TITLE.textContent(); return ApfAuthTitle; @@ -117,7 +112,7 @@ class ApfAuthPage{ console.log('SMP/E span is visible.'); await this.select_SMPE.click({timeout: 9000}) } - + async fillApfDetails(datasetPrefix:string, authLoadLib:string,authpluginLib:string){ await this.page.waitForTimeout(500) @@ -126,7 +121,7 @@ class ApfAuthPage{ await this.authLoadLib.fill(authLoadLib); await this.authpluginLib.fill(authpluginLib); await this.page.waitForTimeout(5000) - + } async initializeApfauth(){ await this.initApfauth.click() diff --git a/playwright_test/Pages/networking.page.ts b/playwright_test/Pages/networking.page.ts index 4521322a..4ddbb9a0 100644 --- a/playwright_test/Pages/networking.page.ts +++ b/playwright_test/Pages/networking.page.ts @@ -100,7 +100,7 @@ class NetworkingPage{ this.APFAUTH_TITLE = page.locator('//div[text()="APF Authorize Load Libraries"]'); this.continue_ReviewSelector = page.locator('//button[contains(text(), "Continue to APF Auth Setup")]'); this.installationTitle = page.locator('//div[text()="Installation"]'); - this.contiuneToApfAuth = page.locator('//button[text()="Continue to APF Auth Setup"]'); + } async isCheckBoxChecked(component: string,label:string): Promise { @@ -109,15 +109,15 @@ class NetworkingPage{ try { if (await checkboxLocator.isChecked()) { console.log("Checkbox is already checked."); - return true; + return true; } else { - await checkboxLocator.check(); + await checkboxLocator.check(); console.log("Checkbox has been checked."); - return true; + return true; } } catch (error) { console.error("Failed to toggle the checkbox:", error); - return false; + return false; } } async movetoNetworkingPage(){ @@ -176,7 +176,7 @@ class NetworkingPage{ return false; } } - + async isCheckboxCheckedAndBlue(xpath: string): Promise{ @@ -191,18 +191,18 @@ class NetworkingPage{ } catch (error){ console.log('Checkbox not found'); return false; - + } } - + async isMetricsServiceDebugChecked(): Promise { return await this.isCheckboxCheckedAndBlue(this.metricService_debug_checkbox); } - + async clickMetricsServiceDebug(): Promise { await this.click_checkBox(this.metricService_debug_checkbox); } - + async isExplorerUssDebugChecked(): Promise { return await this.isCheckboxCheckedAndBlue(this.explorerUSS_debug_checkbox); } @@ -210,11 +210,11 @@ class NetworkingPage{ async isAppServerDebugChecked(): Promise { return await this.isCheckboxCheckedAndBlue(this.app_server_debug); } - + async clickExplorerUssDebug(): Promise { await this.click_checkBox(this.explorerUSS_debug_checkbox); } - + async clickAppServerDebug(): Promise { await this.click_checkBox(this.app_server_debug); } @@ -222,7 +222,6 @@ class NetworkingPage{ async delete_DomainNameField(){ await this.deleteDomainName.click(); } - async add_DomainNameField(){ await this.addDomainField.click() } @@ -241,9 +240,6 @@ class NetworkingPage{ async is_skipNetworkingButtonEnable(){ return await this.skip_button.isEnabled({ timeout: 5000 }); } - async clickContinueToApfAuth(){ - this.contiuneToApfAuth.click({ timeout: 2000 }) - } async click_skipNetworking(){ const isEnabled = await this.is_skipNetworkingButtonEnable(); @@ -292,9 +288,9 @@ class NetworkingPage{ allText += newText; await this.page.evaluate(() => { const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - editor.scrollTop += 100; + editor.scrollTop += 100; }); - await this.page.waitForTimeout(1000); + await this.page.waitForTimeout(1000); const currentScrollHeight = await this.page.evaluate(() => { const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); return editor.scrollHeight; From b45b6e4d2aabd3a55dff365b0f121cfdd53b6433 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Wed, 12 Feb 2025 17:18:51 +0530 Subject: [PATCH 6/6] Updated state management tests for Planning and InstallationType page Signed-off-by: sagar-1310 --- .../Pages/installationType.page.ts | 140 +++---- playwright_test/Pages/planning.page.ts | 148 +++---- .../Tests/InstallationType.spec.ts | 153 +++++-- playwright_test/Tests/Planning.spec.ts | 377 +++++++++++------- .../StateManagementInstallationType.spec.ts | 139 ------- .../Tests/StateManagementPlanning.spec.ts | 139 ------- 6 files changed, 478 insertions(+), 618 deletions(-) delete mode 100644 playwright_test/Tests/StateManagementInstallationType.spec.ts delete mode 100644 playwright_test/Tests/StateManagementPlanning.spec.ts diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index dae74577..00a9f8c3 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -1,6 +1,6 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; -class InstallationTypePage{ +class InstallationTypePage { page: Page; pageTitle: Locator; downloadPax: Locator; @@ -20,6 +20,12 @@ class InstallationTypePage{ disagreeLicense: Locator; installation_Type_Tab: Locator; continueToUnpaxButton: Locator; + installationPageTitle: Locator; + retrieveExampleZoweYaml: Locator; + continueCompInstallation: Locator; + skipUnpaxButton: Locator; + SkipUnpax: Locator; + click_InitializationStage: Locator; constructor(page: Page) { this.page = page; @@ -29,7 +35,7 @@ class InstallationTypePage{ this.uploadPax = page.locator("//span[text()='Upload Zowe PAX for offline install']/preceding-sibling::span/input") this.smpe = page.locator("//span[text()='SMP/E']/preceding-sibling::span/input") this.licenseAgreement = page.locator("//button[text()='License Agreement']") - this.saveAndClose = page.locator("//button[contains(text(),'Save & close')]") + this.saveAndClose = page.locator("//button[contains(text(),'Save & close')]") this.previousStep = page.locator("//button[contains(text(),'Previous step')]") this.continueToComponentInstallation = page.locator("//button[text()='Continue to Components Installation']") this.zoweLink = page.locator("//a[@href='zowe.org']") @@ -40,65 +46,65 @@ class InstallationTypePage{ this.validateLocation = page.locator("//button[text()= 'Validate location']") this.validateLocationGreenCheck = page.locator("//button[text()='Validate location']//following-sibling::*[@data-testid='CheckCircleIcon']") this.licenseAgreementGreenCheck = page.locator("//button[text()='License Agreement']//following-sibling::*[@data-testid='CheckCircleIcon']") - this.retrieveExampleZoweYaml = page.locator("//button[contains(text(),'Retrieve example-zowe.yaml')]") - this.continueCompInstallation = page.locator("//button[contains(text(),'Continue to Components Installation')]") - this.skipUnpaxButton = page.locator("//button[text()='Skip ']") - this.continueToUnpaxButton = page.locator("//button[contains(text(),'Continue to Unpax')]") + this.retrieveExampleZoweYaml = page.locator("//button[contains(text(),'Retrieve example-zowe.yaml')]") + this.continueCompInstallation = page.locator("//button[contains(text(),'Continue to Components Installation')]") + this.skipUnpaxButton = page.locator("//button[text()='Skip ']") + this.continueToUnpaxButton = page.locator("//button[contains(text(),'Continue to Unpax')]") this.SkipUnpax = page.locator('//button[contains(text(),"Skip")]') - this.retrieveExampleZoweYaml= page.locator('//button[contains(text(),"Retrieve example-zowe.yaml")]') + this.retrieveExampleZoweYaml = page.locator('//button[contains(text(),"Retrieve example-zowe.yaml")]') this.click_InitializationStage = page.locator('//span[text()="Initialization"]') this.installation_Type_Tab = page.locator('//span[text()="Installation Type"]') } - async clickInstallationTypeTab(){ - await this.installation_Type_Tab.click({timeout: 9000}) - } + async clickInstallationTypeTab() { + await this.installation_Type_Tab.click({ timeout: 9000 }) + } - async getInstallationTypePageTitle(){ + async getInstallationTypePageTitle() { return await this.pageTitle.textContent({ timeout: 2000 }); } - async selectDownloadZowePax(){ - await this.downloadPax.click({timeout: 5000}) + async selectDownloadZowePax() { + await this.downloadPax.click({ timeout: 5000 }) } - async isDownloadZowePaxSelected(){ + async isDownloadZowePaxSelected() { await this.page.waitForTimeout(1000) return await this.downloadPax.isChecked() } - async selectUploadZowePax(){ - await this.uploadPax.click({timeout: 5000}); + async selectUploadZowePax() { + await this.uploadPax.click({ timeout: 5000 }); } - async isUploadZowePaxSelected(){ + async isUploadZowePaxSelected() { await this.page.waitForTimeout(1000) return await this.uploadPax.isChecked() } - async selectSmpe(){ - await this.smpe.click({timeout: 5000}); + async selectSmpe() { + await this.smpe.click({ timeout: 5000 }); } - async continueToUnpax(){ - await this.continueToUnpax.click({ timeout: 2000 }) + async continueToUnpax() { + await this.continueToUnpaxButton.click({ timeout: 2000 }) } - async retrieveExampleYaml(){ - await this.retrieveExampleZoweYaml.click({timeout: 5000}); + async retrieveExampleYaml() { + await this.retrieveExampleZoweYaml.click({ timeout: 5000 }); } - async continueComponentInstallation(){ + async continueComponentInstallation() { const timeout = 5000; - const interval = 500; - while (true) { - if (await this.continueCompInstallation.isEnabled()) { - await this.continueCompInstallation.click(); - return; + const interval = 500; + while (true) { + if (await this.continueCompInstallation.isEnabled()) { + await this.continueCompInstallation.click(); + return; } await this.page.waitForTimeout(interval); } - await this.continueCompInstallation.click({timeout: timeout}); + await this.continueCompInstallation.click({ timeout: timeout }); } private async waitForInstallationPageVisible(): Promise { @@ -115,114 +121,110 @@ class InstallationTypePage{ throw new Error('Timed out waiting for the Installation Page to become visible.'); } - async isSmpeSelected(){ + async isSmpeSelected() { await this.page.waitForTimeout(1000) return await this.smpe.isChecked() } - async clickZoweLink(){ + async clickZoweLink() { await this.zoweLink.click(); } - async clickLicenseAgreement(){ - await this.licenseAgreement.click({timeout: 5000}); + async clickLicenseAgreement() { + await this.licenseAgreement.click({ timeout: 5000 }); } - async clickSaveAndClose(){ - await this.saveAndClose.click({timeout: 5000}); + async clickSaveAndClose() { + await this.saveAndClose.click({ timeout: 5000 }); } - async clickPreviousStep(){ + async clickPreviousStep() { await this.previousStep.click(); } - async clickContinueToInstallation(){ + async clickContinueToInstallation() { await this.continueToComponentInstallation.click(); } - async isContinueToComponentInstallationDisabled(){ + async isContinueToComponentInstallationDisabled() { return await this.continueToComponentInstallation.isDisabled() } - async isContinueToComponentInstallationEnabled(){ + async isContinueToComponentInstallationEnabled() { return await this.continueToComponentInstallation.isEnabled() } - async isContinueUnpaxEnabled(){ - return await this.continueToUnpax.isEnabled() - } - - async clickAgreeLicense(){ - await this.agreeLicense.click({timeout: 5000}); + async clickAgreeLicense() { + await this.agreeLicense.click({ timeout: 5000 }); } - async clickDisagreeLicense(){ + async clickDisagreeLicense() { await this.page.waitForTimeout(1000) - await this.disagreeLicense.click({timeout: 5000}); + await this.disagreeLicense.click({ timeout: 5000 }); } - async isLicenseAgreementGreenCheckVisible(){ + async isLicenseAgreementGreenCheckVisible() { await this.page.waitForTimeout(5000); - return await this.licenseAgreementGreenCheck.isVisible({timeout: 5000}); + return await this.licenseAgreementGreenCheck.isVisible({ timeout: 5000 }); } - async clickUploadPaxButton(){ - await this.uploadPaxButton.click({timeout: 5000}); + async clickUploadPaxButton() { + await this.uploadPaxButton.click({ timeout: 5000 }); } - async skipUnpax(){ - await this.skipUnpaxButton.click({timeout: 5000}); + async skipUnpax() { + await this.skipUnpaxButton.click({ timeout: 5000 }); await this.waitForInstallationPageVisible(); } - async enterRuntimeDir(runtimeDir: any){ - await this.runtimeDir.clear({timeout: 5000}) + async enterRuntimeDir(runtimeDir: any) { + await this.runtimeDir.clear({ timeout: 5000 }) await this.runtimeDir.fill(runtimeDir); } - async clickValidateLocation(){ - await this.validateLocation.click({timeout: 5000}); + async clickValidateLocation() { + await this.validateLocation.click({ timeout: 5000 }); } - async isValidateLocationGreenCheckVisible(){ + async isValidateLocationGreenCheckVisible() { return await this.validateLocationGreenCheck.isVisible(); } - async downloadZowePaxAndNavigateToInstallationPage(){ + async downloadZowePaxAndNavigateToInstallationPage() { await this.selectDownloadZowePax() await this.clickLicenseAgreement() await this.clickAgreeLicense() } - async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any){ + async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any) { this.selectUploadZowePax() await this.uploadPaxButton.setInputFiles(uploadPaxPath) } - async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any){ + async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any) { this.selectSmpe() this.enterRuntimeDir(runtimeDir) this.clickValidateLocation() } - async clickOnContinueToUnpax(){ + async clickOnContinueToUnpax() { this.continueToUnpaxButton.click({ timeout: 2000 }) } - async isContinueToUnpaxEnabled(){ + async isContinueToUnpaxEnabled() { return await this.continueToUnpaxButton.isEnabled() } - async clickSkipUnpaxButton(){ + async clickSkipUnpaxButton() { this.SkipUnpax.click({ timeout: 2000 }) } - async clickRetrieveExZoweYaml(){ + async clickRetrieveExZoweYaml() { this.retrieveExampleZoweYaml.click({ timeout: 15000 }) } - async MoveToInitializationStage(){ + async MoveToInitializationStage() { this.click_InitializationStage.click({ timeout: 15000 }) } } - export default InstallationTypePage; +export default InstallationTypePage; diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 091fe439..01b72dec 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -1,7 +1,6 @@ import { Locator, Page } from '@playwright/test'; -let page: Page; -class PlanningPage{ +class PlanningPage { page: Page; planningPageTitle: Locator; zoweInstallationLink: Locator; @@ -12,13 +11,8 @@ class PlanningPage{ workspaceDir: Locator; logsDir: Locator; extensionsDir: Locator; - rbacProfileIdentifier: Locator; - jobName: Locator; - jobPrefix: Locator; - cookieIdentifier: Locator; javaLocation: Locator; nodeJsLocation: Locator; - setZosmf: Locator; zosmfHost: Locator; zosmfPort: Locator; zosmfApplicationId: Locator; @@ -42,16 +36,10 @@ class PlanningPage{ this.workspaceDir = page.locator("//label[contains(text(),'Workspace Directory')]//following-sibling::div/input") this.logsDir = page.locator("//label[contains(text(),'Log Directory')]//following-sibling::div/input") this.extensionsDir = page.locator("//label[contains(text(),'Extensions Directory')]//following-sibling::div/input") - this.rbacProfileIdentifier = page.locator("//label[contains(text(),'Rbac Profile Identifier')]//following-sibling::div/input") - this.jobName = page.locator("//label[contains(text(),'Job Name')]//following-sibling::div/input") - this.jobPrefix = page.locator("//label[contains(text(),'Job Prefix')]//following-sibling::div/input") - this.cookieIdentifier = page.locator("//label[contains(text(),'Cookie Identifier')]//following-sibling::div/input") this.javaLocation = page.locator("//label[contains(text(),'Java Home Directory')]//following-sibling::div/input") this.nodeJsLocation = page.locator("//label[contains(text(),'Node.js Home Directory')]//following-sibling::div/input") - this.setZosmf = page.locator("//span[text()='Set z/OSMF Attributes (optional)']/preceding-sibling::span/input") this.zosmfHost = page.locator("//label[contains(text(),'z/OSMF Host')]//following-sibling::div/input") this.zosmfPort = page.locator('//label[contains(text(), "z/OSMF Port")]/following-sibling::div/input[@id="zosmf-port"]') - //this.zosmfPort = page.locator('//input[@id="zosmf-port"]'); this.zosmfApplicationId = page.locator("//label[contains(text(),'z/OSMF Application Id')]//following-sibling::div/input") this.validateLocations = page.locator("//button[contains(text(), 'Validate locations')]") this.ValidateLocationsGreenCheck = page.locator("//button[text()='Validate locations']//following-sibling::*[@data-testid='CheckCircleIcon']") @@ -59,35 +47,35 @@ 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(){ + async clickZoweInstallationLink() { await this.page.waitForTimeout(500); await this.zoweInstallationLink.click(); } - async getPlanningPageTitle(){ + async getPlanningPageTitle() { await this.page.waitForTimeout(1000); return await this.planningPageTitle.textContent(); } - async getJobStatement(){ + async getJobStatement() { await this.page.waitForTimeout(1000); return await this.jobStatement.textContent(); } - async click_saveAndClose(){ + async click_saveAndClose() { await this.page.waitForTimeout(5000); await this.save_and_close.click({ timeout: 2000 }) } - async enterJobStatement(jobStatement: string){ + async enterJobStatement(jobStatement: string) { await this.page.waitForTimeout(500); await this.jobStatement.fill(jobStatement); } - async clickSaveAndValidate(){ + async clickSaveAndValidate() { await this.saveAndValidate.click({ timeout: 5000 }); } @@ -102,110 +90,71 @@ class PlanningPage{ } } - async getErrorMessage(){ + async getErrorMessage() { await this.page.waitForTimeout(1000); return await this.errorMessage.textContent(); } - async enterRuntimeDir(runtimeDir: any){ + async enterRuntimeDir(runtimeDir: any) { await this.page.waitForTimeout(500); - //await this.runtimeDir.clear({timeout: 2000}) await this.runtimeDir.fill(runtimeDir); } - async getrRuntimeDir(){ - const value = await this.runtimeDir.inputValue(); - return value; + async getrRuntimeDir() { + const value = await this.runtimeDir.inputValue(); + return value; } - async enterWorkspaceDir(workspaceDir: any){ + async enterWorkspaceDir(workspaceDir: any) { await this.page.waitForTimeout(500); - await this.workspaceDir.clear({timeout: 2000}) + await this.workspaceDir.clear({ timeout: 2000 }) await this.workspaceDir.fill(workspaceDir); } - async enterLogsDir(logsDir: any){ + async enterLogsDir(logsDir: any) { await this.page.waitForTimeout(500); - await this.logsDir.clear({timeout: 2000}) + await this.logsDir.clear({ timeout: 2000 }) await this.logsDir.fill(logsDir); } - async enterExtensionsDir(extensionsDir: any){ + async enterExtensionsDir(extensionsDir: any) { await this.page.waitForTimeout(500); - await this.extensionsDir.clear({timeout: 2000}) + await this.extensionsDir.clear({ timeout: 2000 }) await this.extensionsDir.fill(extensionsDir); } - async enterRbacProfileIdentifier(rbacProfileIdentifier: any){ + async enterJavaLocation(javaLocation: any) { await this.page.waitForTimeout(500); - await this.rbacProfileIdentifier.clear({timeout: 2000}) - await this.rbacProfileIdentifier.fill(rbacProfileIdentifier); - } - - async enterJobName(jobName: any){ - await this.page.waitForTimeout(500); - await this.jobName.clear({timeout: 2000}) - await this.jobName.fill(jobName); - } - - async enterJobPrefix(jobPrefix: any){ - await this.page.waitForTimeout(500); - await this.jobPrefix.clear({timeout: 2000}) - await this.jobPrefix.fill(jobPrefix); - } - - async enterCookieIdentifier(cookieIdentifier: any){ - await this.page.waitForTimeout(500); - await this.cookieIdentifier.clear({timeout: 2000}) - await this.cookieIdentifier.fill(cookieIdentifier); - } - - async enterJavaLocation(javaLocation: any){ - await this.page.waitForTimeout(500); - await this.javaLocation.clear({timeout: 2000}) + await this.javaLocation.clear({ timeout: 2000 }) await this.javaLocation.fill(javaLocation); } - async enterNodeJsLocation(nodeJsLocation: any){ + async enterNodeJsLocation(nodeJsLocation: any) { await this.page.waitForTimeout(500); - await this.nodeJsLocation.clear({timeout: 2000}) + await this.nodeJsLocation.clear({ timeout: 2000 }) await this.nodeJsLocation.fill(nodeJsLocation); } - async isSetZosmfAttributeChecked(){ - await this.page.waitForTimeout(1000); - return await this.setZosmf.isChecked(); - } - - async checkSetZosmfAttribute(){ - await this.page.waitForTimeout(1000); - if (await this.isSetZosmfAttributeChecked() == false){ - await this.setZosmf.click(); - } - - } - - async enterZosmfHost(zosmfHost: any){ + async enterZosmfHost(zosmfHost: any) { await this.page.waitForTimeout(500); - await this.zosmfHost.clear({timeout: 2000}) + await this.zosmfHost.clear({ timeout: 2000 }) await this.zosmfHost.fill(zosmfHost); } - async enterZosmfPort(zosmfPort: any){ + async enterZosmfPort(zosmfPort: any) { await this.page.waitForTimeout(500); - await this.zosmfPort.clear({timeout: 2000}) + await this.zosmfPort.clear({ timeout: 2000 }) await this.zosmfPort.fill(zosmfPort); } - async enterZosmfApplicationId(zosmfApplicationId: any){ + async enterZosmfApplicationId(zosmfApplicationId: any) { await this.page.waitForTimeout(500); - await this.zosmfApplicationId.clear({timeout: 2000}) + await this.zosmfApplicationId.clear({ timeout: 2000 }) await this.zosmfApplicationId.fill(zosmfApplicationId); } - async clickValidateLocations(){ - await this.validateLocations.click({timeout: 5000}); - await this.waitForContinueButtonToBeEnabled(); + async clickValidateLocations() { + await this.validateLocations.click({ timeout: 5000 }); } async isValidateLocationsGreenCheckVisible(): Promise { @@ -218,18 +167,17 @@ class PlanningPage{ } } - - async clickSaveAndClose(){ + async clickSaveAndClose() { await this.page.waitForTimeout(5000); await this.save_and_close.click({ timeout: 5000 }) } - async clickPreviousStep(){ + async clickPreviousStep() { await this.page.waitForTimeout(500); await this.previousStep.click(); } - private async waitForContinueButtonToBeEnabled(): Promise { + async waitForContinueButtonToBeEnabled(): Promise { const timeout = 100000; // Adjust the timeout as needed const interval = 500; const endTime = Date.now() + timeout; @@ -246,49 +194,43 @@ class PlanningPage{ return false; // Button did not become enabled } - async clickContinueToInstallation(){ + async clickContinueToInstallation() { const timeout = 30000; const interval = 100; const startTime = Date.now(); - const isButtonEnabled = async (): Promise => { + const isButtonEnabled = async (): Promise => { return await this.isContinueToInstallationEnabled(); }; - while (!(await isButtonEnabled())) { + while (!(await isButtonEnabled())) { if (Date.now() - startTime > timeout) { throw new Error('Timed out waiting for the button to be enabled.'); } await new Promise(resolve => setTimeout(resolve, interval)); } await this.continueInstallationOptions.click(); -} + } - async isContinueToInstallationDisabled(){ + async isContinueToInstallationDisabled() { await this.page.waitForTimeout(500); return await this.continueInstallationOptions.isDisabled() } - async isContinueToInstallationEnabled(){ + async isContinueToInstallationEnabled() { await this.page.waitForTimeout(500); return await this.continueInstallationOptions.isEnabled() } - async getReadyToProceedMessage(){ + async getReadyToProceedMessage() { await this.page.waitForTimeout(1000); return await this.readyToProceedMessage.textContent({ timeout: 2000 }); } - async isContinueToInstallationDisabled(){ - await this.page.waitForTimeout(500); - return await this.continueInstallationOptions.isDisabled() - } - - async clickSaveValidate(){ + async clickSaveValidate() { await this.jobStatement.fill("//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A") await this.saveAndValidate.click(); - await this.page.waitForTimeout(500); + await this.page.waitForTimeout(2000); } - - async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: 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); @@ -302,4 +244,4 @@ class PlanningPage{ await this.page.waitForTimeout(2000); } } - export default PlanningPage; +export default PlanningPage; diff --git a/playwright_test/Tests/InstallationType.spec.ts b/playwright_test/Tests/InstallationType.spec.ts index 6bae3d29..6113f063 100644 --- a/playwright_test/Tests/InstallationType.spec.ts +++ b/playwright_test/Tests/InstallationType.spec.ts @@ -7,10 +7,8 @@ import InstallationPage from '../Pages/installation.page.ts'; import config from '../utils/config'; import { prepareEnvironment } from '../prepare.js'; - let electronApp: ElectronApplication const PLANNING_TITLE = 'Before you start'; -const INSTALLATION_PAGE_TITLE = 'Installation'; const DOWNLOAD_ZOWE_PAX = 'Download Zowe Pax'; test.beforeAll(async () => { @@ -25,12 +23,12 @@ test.beforeAll(async () => { test.describe('InstallationTypeTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; + let titlePage: TitlePage; + let installationTypePage: InstallationTypePage; + let planningPage: PlanningPage; + let installationPage: InstallationPage; - test.beforeEach(async ({ page }) => { + async function launch_Zen({ page }) { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) page = await electronApp.firstWindow() @@ -39,20 +37,25 @@ test.describe('InstallationTypeTab', () => { planningPage = new PlanningPage(page); installationTypePage = new InstallationTypePage(page); installationPage = new InstallationPage(page); - await titlePage.navigateToConnectionTab() + await page.waitForTimeout(5000) + } + + test.beforeEach(async ({ page }) => { + await launch_Zen({ 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 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() }) @@ -69,7 +72,7 @@ test.describe('InstallationTypeTab', () => { expect(installationTypePage.saveAndClose).toBeTruthy() expect(installationTypePage.previousStep).toBeTruthy() expect(installationTypePage.continueToComponentInstallation).toBeTruthy() - const is_continue_button_enabled = await installationTypePage.isContinueUnpaxEnabled(); + const is_continue_button_enabled = await installationTypePage.isContinueToUnpaxEnabled(); expect(is_continue_button_enabled).toBe(false); }) @@ -79,20 +82,20 @@ test.describe('InstallationTypeTab', () => { await installationTypePage.clickAgreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const is_continue_button_enabled = await installationTypePage.isContinueUnpaxEnabled(); + const is_continue_button_enabled = await installationTypePage.isContinueToUnpaxEnabled(); expect(is_continue_button_enabled).toBe(true); }) /* Need to figure out new logic test('Test Upload Zowe Pax', async ({ page }) => { await installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); - })*/ + })*/ test('Test SMPE ', async ({ page }) => { await installationTypePage.selectSmpe() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -106,26 +109,114 @@ test.describe('InstallationTypeTab', () => { await installationTypePage.selectDownloadZowePax() await installationTypePage.clickLicenseAgreement() await installationTypePage.clickAgreeLicense() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await installationTypePage.clickOnContinueToUnpax() const title = await installationPage.getInstallationPageTitle(); expect(title).toBe(DOWNLOAD_ZOWE_PAX); }) - test('Test Save and Close and Resume Progress', async ({page}) => { + test('Test Save and Close and Resume Progress', async ({ page }) => { await installationTypePage.selectDownloadZowePax() await installationTypePage.clickLicenseAgreement() await installationTypePage.clickAgreeLicense() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await installationTypePage.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 is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const Is_Continue_Button_Enable_After_Save = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable_After_Save = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable_After_Save).toBe(true); - }) + }) + + test('Test Select Downlad Zowe Pax', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); + expect(is_Download_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); + expect(is_Download_Zowe_Pax_Selected).toBe(true); + }) + + test('Test Select Upload Zowe Pax', async ({ page }) => { + installationTypePage.selectUploadZowePax() + const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); + expect(is_Upload_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); + expect(is_Upload_Zowe_Pax_Selected).toBe(true); + }) + + test('Test Select SMPE', async ({ page }) => { + installationTypePage.selectSmpe(); + const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); + expect(is_SMPE_Selected).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); + expect(is_SMPE_Selected).toBe(true); + expect(Is_Continue_Button_Enable).toBe(true); + }) + + test('Test Agree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickAgreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); + expect(is_GreenCheck_Visible).toBe(true); + expect(Is_Continue_Button_Enable).toBe(true); + }) + + test('Test Disagree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickDisagreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(false); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); + expect(is_GreenCheck_Visible).toBe(false); + expect(Is_Continue_Button_Enable).toBe(false); + }) }) diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 5007d065..3d920ed6 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -1,153 +1,256 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; +import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; import ConnectionPage from '../Pages/connection.page'; import TitlePage from '../Pages/title.page'; import PlanningPage from '../Pages/planning.page.ts'; import InstallationTypePage from '../Pages/installationType.page.ts'; -import path from 'path'; -let page: Page; import config from '../utils/config'; let electronApp: ElectronApplication -const CONNECTION_PAGE_TITLE = 'Connection'; const PLANNING_TITLE = 'Before you start'; const INSTALLATION_TYPE_TITLE = 'Installation Type'; const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; const ERROR_MESSAGE = `Failed to verify job statement STMT NO. MESSAGE\r\n 1 IEFC006I POSITIONAL PARAMETERS MUST BE SPECIFIED BEFORE KEYWORD PARAMETERS`; const EMPTY_ERROR = "Error invoking remote method 'get-env-vars': Error: Failed to submit jcl, job id not found"; const INVALID_INPUT_ERROR = 'Test/DIR is not a valid z/OS Unix path' +const VALID_JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A"; test.describe('PlanningTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let planningPage: PlanningPage; - let installationTypePage: InstallationTypePage - - test.beforeEach(async () => { - 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); - 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(); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test Valid Job Statement and Save Validate', async () => { - await planningPage.clickSaveValidate(); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(true); - }) - - test('Test Invalid Job Statement and Save Validate', async () => { - await planningPage.enterJobStatement(INVALID_JOB_STATEMENT); - await planningPage.clickSaveAndValidate(); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message.trim()).toBe(ERROR_MESSAGE.trim()); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - }) - - test('Test Empty Job Statement and Save Validate', async () => { - await planningPage.enterJobStatement(''); - await planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(EMPTY_ERROR); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - }) - - test('Test all required fields on Planning Tab After Job Validation', async () => { - await planningPage.clickSaveValidate(); - expect(planningPage.runtimeDir).toBeTruthy(); - expect(planningPage.workspaceDir).toBeTruthy(); - expect(planningPage.logsDir).toBeTruthy(); - expect(planningPage.extensionsDir).toBeTruthy(); - expect(planningPage.rbacProfileIdentifier).toBeTruthy(); - expect(planningPage.jobName).toBeTruthy(); - expect(planningPage.jobPrefix).toBeTruthy(); - expect(planningPage.cookieIdentifier).toBeTruthy(); - expect(planningPage.javaLocation).toBeTruthy(); - expect(planningPage.nodeJsLocation).toBeTruthy(); - expect(planningPage.setZosmf).toBeTruthy(); - expect(planningPage.zosmfHost).toBeTruthy(); - expect(planningPage.zosmfPort).toBeTruthy(); - expect(planningPage.zosmfApplicationId).toBeTruthy(); - expect(planningPage.validateLocations).toBeTruthy(); - expect(planningPage.save_and_close).toBeTruthy(); - expect(planningPage.previousStep).toBeTruthy(); - expect(planningPage.continueInstallationOptions).toBeTruthy(); - const is_Continue_Button_disable = await planningPage.isContinueToInstallationDisabled(); - expect(is_Continue_Button_disable).toBe(true); - }) - - test('Test Validate Locations with Valid Data', async () => { - 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() - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(true); - await planningPage.clickContinueToInstallation(); - const installationType_title = await installationTypePage.getInstallationTypePageTitle() - expect (installationType_title).toBe(INSTALLATION_TYPE_TITLE); - }) - - test('Test Validate Locations with Invalid Data', async () => { - await planningPage.clickSaveValidate(); - await planningPage.enterRuntimeDir('Test/DIR'); - await planningPage.enterWorkspaceDir('Workspace Dir'); - await planningPage.enterLogsDir(config.ZOWE_LOG_DIR); - await planningPage.enterExtensionsDir(config.ZOWE_EXTENSION_DIR); - await planningPage.enterJavaLocation('/'); - await planningPage.enterNodeJsLocation(config.NODE_HOME); - await planningPage.enterZosmfApplicationId('ABCDDDETT'); - await planningPage.clickValidateLocations(); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(INVALID_INPUT_ERROR); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationDisabled(); - expect(is_Continue_Button_enable).toBe(true); - }) - - - test('Test Save and Close and Resume Progress', async () => { - 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.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 planningPage.getPlanningPageTitle(); - expect(title).toBe(PLANNING_TITLE); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(true); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage + + async function launch_Zen({ 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); + installationTypePage = new InstallationTypePage(page); + await page.waitForTimeout(5000) + } + + test.beforeEach(async ({ page }) => { + await launch_Zen({ page }) + titlePage.navigateToConnectionTab(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test Valid Job Statement and Save Validate', async ({ page }) => { + await planningPage.clickSaveValidate(); + await page.waitForTimeout(5000) + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + }) + + test('Test Invalid Job Statement and Save Validate', async () => { + await planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await planningPage.clickSaveAndValidate(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message.trim()).toBe(ERROR_MESSAGE.trim()); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + }) + + test('Test Empty Job Statement and Save Validate', async () => { + await planningPage.enterJobStatement(''); + await planningPage.clickSaveAndValidate(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(EMPTY_ERROR); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + }) + + test('Test all required fields on Planning Tab After Job Validation', async () => { + await planningPage.clickSaveValidate(); + expect(planningPage.runtimeDir).toBeTruthy(); + expect(planningPage.workspaceDir).toBeTruthy(); + expect(planningPage.logsDir).toBeTruthy(); + expect(planningPage.extensionsDir).toBeTruthy(); + expect(planningPage.javaLocation).toBeTruthy(); + expect(planningPage.nodeJsLocation).toBeTruthy(); + expect(planningPage.zosmfHost).toBeTruthy(); + expect(planningPage.zosmfPort).toBeTruthy(); + expect(planningPage.zosmfApplicationId).toBeTruthy(); + expect(planningPage.validateLocations).toBeTruthy(); + expect(planningPage.save_and_close).toBeTruthy(); + expect(planningPage.previousStep).toBeTruthy(); + expect(planningPage.continueInstallationOptions).toBeTruthy(); + const is_Continue_Button_disable = await planningPage.isContinueToInstallationDisabled(); + expect(is_Continue_Button_disable).toBe(true); + }) + + test('Test Validate Locations with Valid Data', async ({ page }) => { + 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.waitForContinueButtonToBeEnabled(); + await page.waitForTimeout(5000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); + await planningPage.clickContinueToInstallation(); + const installationType_title = await installationTypePage.getInstallationTypePageTitle() + expect(installationType_title).toBe(INSTALLATION_TYPE_TITLE); + }) + + test('Test Validate Locations with Invalid Data', async () => { + await planningPage.clickSaveValidate(); + await planningPage.enterRuntimeDir('Test/DIR'); + await planningPage.enterWorkspaceDir('Workspace Dir'); + await planningPage.enterLogsDir(config.ZOWE_LOG_DIR); + await planningPage.enterExtensionsDir(config.ZOWE_EXTENSION_DIR); + await planningPage.enterJavaLocation('/'); + await planningPage.enterNodeJsLocation(config.NODE_HOME); + await planningPage.enterZosmfApplicationId('ABCDDDETT'); + await planningPage.clickValidateLocations(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(INVALID_INPUT_ERROR); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationDisabled(); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Save and Close and Resume Progress', async ({ page }) => { + 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.waitForContinueButtonToBeEnabled(); + await page.waitForTimeout(5000); + await planningPage.click_saveAndClose() + await titlePage.clickOnResumeProgress(); + await connectionPage.fillPassword(config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + const title = await planningPage.getPlanningPageTitle(); + expect(title).toBe(PLANNING_TITLE); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Added Job Statement and Not Validated', async ({ page }) => { + planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await page.waitForTimeout(2000) + planningPage.clickSaveAndValidate(); + await page.waitForTimeout(5000) + const jobstatement = await planningPage.getJobStatement(); + expect(jobstatement).toBe(INVALID_JOB_STATEMENT); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); + expect(jobstatement).toBe(INVALID_JOB_STATEMENT); + expect(isGreen_check_visible).toBe(false); + }) + + test('Test Added Job Statement and Validated Successfully', async ({ page }) => { + planningPage.enterJobStatement(VALID_JOB_STATEMENT); + await page.waitForTimeout(2000) + planningPage.clickSaveAndValidate(); + await page.waitForTimeout(5000); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); + expect(isGreen_check_visible).toBe(true); + }) + + test('Test Locations Validated and Planning Step Completed', async ({ page }) => { + await page.waitForTimeout(2000); + 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 page.waitForTimeout(2000); + planningPage.clickValidateLocations() + planningPage.waitForContinueButtonToBeEnabled(); + await page.waitForTimeout(5000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); + expect(is_GreenCheck_Visible).toBe(true); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Locations Not Validated and Planning Step Pending', async ({ page }) => { + await page.waitForTimeout(2000) + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + 'TESTABC', + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + 'JAVA_HOME', + '12345', + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await page.waitForTimeout(2000) + planningPage.clickValidateLocations() + await page.waitForTimeout(5000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const is_Continue_Button_disable = await planningPage.isContinueToInstallationDisabled(); + expect(is_Continue_Button_disable).toBe(true); + await electronApp.close() + await launch_Zen({ page }) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); + expect(is_GreenCheck_Visible).toBe(false); + expect(is_Continue_Button_disable).toBe(true); }) +}) diff --git a/playwright_test/Tests/StateManagementInstallationType.spec.ts b/playwright_test/Tests/StateManagementInstallationType.spec.ts deleted file mode 100644 index 2ed58ca1..00000000 --- a/playwright_test/Tests/StateManagementInstallationType.spec.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import ConnectionPage from '../Pages/connection.page.ts'; -import TitlePage from '../Pages/title.page.ts'; -import PlanningPage from '../Pages/planning.page.ts'; -import InstallationTypePage from '../Pages/installationType.page.ts'; -import config from '../utils/config.ts'; -let page: Page; - -let electronApp: ElectronApplication - -test.describe('InstallationTypeTab', () => { - let connectionPage: ConnectionPage; - let titlePage: TitlePage; - let planningPage: PlanningPage; - let installationTypePage: InstallationTypePage; - - async function launch_Zen({ 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); - installationTypePage = new InstallationTypePage(page); - await page.waitForTimeout(5000) - } - - test.beforeEach(async () => { - await launch_Zen({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() - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test Select Downlad Zowe Pax', async ({ page }) => { - installationTypePage.selectDownloadZowePax() - const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); - expect(is_Download_Zowe_Pax_Selected).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - installationTypePage.clickInstallationTypeTab(); - await page.waitForTimeout(2000); - expect(is_Download_Zowe_Pax_Selected).toBe(true); - }) - - test('Test Select Upload Zowe Pax', async ({ page }) => { - installationTypePage.selectUploadZowePax() - const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); - expect(is_Upload_Zowe_Pax_Selected).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - installationTypePage.clickInstallationTypeTab(); - await page.waitForTimeout(2000); - expect(is_Upload_Zowe_Pax_Selected).toBe(true); - }) - - test('Test Select SMPE', async ({ page }) => { - installationTypePage.selectSmpe(); - const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); - expect(is_SMPE_Selected).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); - expect(Is_Continue_Button_Enable).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - installationTypePage.clickInstallationTypeTab(); - await page.waitForTimeout(2000); - expect(is_SMPE_Selected).toBe(true); - expect(Is_Continue_Button_Enable).toBe(true); - }) - - test('Test Agree License Agreement', async ({ page }) => { - installationTypePage.selectDownloadZowePax() - installationTypePage.clickLicenseAgreement() - installationTypePage.clickAgreeLicense() - const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); - expect(Is_Continue_Button_Enable).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - installationTypePage.clickInstallationTypeTab(); - await page.waitForTimeout(2000); - expect(is_GreenCheck_Visible).toBe(true); - expect(Is_Continue_Button_Enable).toBe(true); - }) - - test('Test Disagree License Agreement', async ({ page }) => { - installationTypePage.selectDownloadZowePax() - installationTypePage.clickLicenseAgreement() - installationTypePage.clickDisagreeLicense() - const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(false); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); - expect(Is_Continue_Button_Enable).toBe(false); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - installationTypePage.clickInstallationTypeTab(); - await page.waitForTimeout(2000); - expect(is_GreenCheck_Visible).toBe(false); - expect(Is_Continue_Button_Enable).toBe(false); - }) -}) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementPlanning.spec.ts b/playwright_test/Tests/StateManagementPlanning.spec.ts deleted file mode 100644 index 0a5e8987..00000000 --- a/playwright_test/Tests/StateManagementPlanning.spec.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import ConnectionPage from '../Pages/connection.page.ts'; -import TitlePage from '../Pages/title.page.ts'; -import PlanningPage from '../Pages/planning.page.ts'; -import config from '../utils/config.ts'; -let page: Page; - -let electronApp: ElectronApplication -const VALID_JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A"; -const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; - -test.describe('State_Management_PlanningTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let planningPage: PlanningPage; - - async function launch_Zen({ 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); - await page.waitForTimeout(5000) - } - - test.beforeEach(async () => { - await launch_Zen({page}) - titlePage.navigateToConnectionTab(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test Added Job Statement and Not Validated', async ({page}) => { - planningPage.enterJobStatement(INVALID_JOB_STATEMENT); - await page.waitForTimeout(2000) - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(5000) - const jobstatement = await planningPage.getJobStatement(); - expect(jobstatement).toBe(INVALID_JOB_STATEMENT); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await page.waitForTimeout(2000); - expect(jobstatement).toBe(INVALID_JOB_STATEMENT); - expect(isGreen_check_visible).toBe(false); - }) - - test('Test Added Job Statement and Validated Successfully', async ({page}) => { - planningPage.enterJobStatement(VALID_JOB_STATEMENT); - await page.waitForTimeout(2000) - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(5000); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await page.waitForTimeout(2000); - expect(isGreen_check_visible).toBe(true); - }) - - test('Test Locations Validated and Planning Step Completed', async ({page}) => { - await page.waitForTimeout(2000); - 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 page.waitForTimeout(2000); - planningPage.clickValidateLocations() - await page.waitForTimeout(5000); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(true); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await page.waitForTimeout(2000); - expect(is_GreenCheck_Visible).toBe(true); - expect(is_Continue_Button_enable).toBe(true); - }) - - test('Test Locations Not Validated and Planning Step Pending', async ({page}) => { - await page.waitForTimeout(2000) - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, - 'TESTABC', - config.ZOWE_EXTENSION_DIR, - config.ZOWE_LOG_DIR, - 'JAVA_HOME', - '12345', - config.ZOSMF_HOST, - config.ZOSMF_PORT, - config.ZOSMF_APP_ID - ); - await page.waitForTimeout(2000) - planningPage.clickValidateLocations() - await page.waitForTimeout(5000); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(false); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(false); - await electronApp.close() - await launch_Zen({page}) - titlePage.clickOnResumeProgress(); - connectionPage.fillPassword(config.SSH_PASSWD) - await page.waitForTimeout(2000); - await connectionPage.SubmitValidateCredential(); - await connectionPage.clickContinueButton(); - await page.waitForTimeout(2000); - expect(is_GreenCheck_Visible).toBe(false); - expect(is_Continue_Button_enable).toBe(false); - }) -})