From 0fc1a1d070fd21196bfe770eef757806b7da6d77 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Thu, 23 May 2024 00:59:32 +0530 Subject: [PATCH 1/5] 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/5] 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/5] 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/5] 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/5] 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;