Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

draft for STCS test cases #230

Open
wants to merge 3 commits into
base: v2.x/rc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions playwright_test/Pages/connection.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page,Locator } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

missing header

class ConnectionPage{
page: Page;
Expand All @@ -24,8 +24,7 @@
this.resumeProgress = page.locator('//button[contains(text(),"Resume Progress")]')
this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium')
this.greenCheckIconSelector = page.locator('.MuiContainer-root svg[data-testid="CheckCircleIcon"]')


this.status_check = page.locator(".svg.MuiSvgIcon-root.MuiSvgIcon-fontSizeMedium[data-testid='CheckCircleIcon']")

}
async fillConnectionDetails(host: string, port: string, username: string, password: string){
Expand All @@ -37,6 +36,12 @@
await this.userName.fill(username)
await this.page.waitForTimeout(1000);
await this.password.fill(password)
await this.page.waitForTimeout(1000);
}

async fillpassword(password: string){
await this.password.fill(password,{timeout: 5000});
await this.page.waitForTimeout(1000);
}

async getHostValue(){
Expand Down Expand Up @@ -75,12 +80,13 @@
async isContinueButtonVisible() {
return await this.continueButton.isDisabled();
}
async clickContinueButton() {

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

View workflow job for this annotation

GitHub Actions / lint

All clickContinueButton signatures should be adjacent
return await this.continueButton.click();
}
async isGreenCheckIconVisible() {
return await this.greenCheckIconSelector.isHidden();
}

}

export default ConnectionPage;
12 changes: 12 additions & 0 deletions playwright_test/Pages/installation.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page,Locator } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

missing header

class InstallationPage{
page: Page;
Expand Down Expand Up @@ -50,7 +50,7 @@
return await this.pageTitle.textContent({ timeout: 2000 });
}

async enterPrefix(prefix: any){

Check warning on line 53 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.prefix.fill(prefix);
}
Expand All @@ -60,7 +60,7 @@
return await this.prefix.textContent();
}

async enterProcLib(proclib: any){

Check warning on line 63 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.procLib.fill(proclib);
}
Expand All @@ -70,7 +70,7 @@
return await this.procLib.textContent();
}

async enterParmLib(parmlib: any){

Check warning on line 73 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.parmLib.fill(parmlib);
}
Expand All @@ -80,22 +80,22 @@
return await this.parmLib.textContent();
}

async enterZis(zis: any){

Check warning on line 83 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.zis.fill(zis);
}

async enterJclLib(Jcllib: any){

Check warning on line 88 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.jclLib.fill(Jcllib);
}

async enterLoadLib(loadlib: any){

Check warning on line 93 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.loadLib.fill(loadlib);
}

async enterAuthLoadLib(authloadlib: any){

Check warning on line 98 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.authLoadLib.fill(authloadlib);
}
Expand All @@ -105,7 +105,7 @@
return await this.authLoadLib.textContent();
}

async enterAuthPluginLib(authpluginlib: any){

Check warning on line 108 in playwright_test/Pages/installation.page.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
await this.page.waitForTimeout(500)
await this.authPluginLib.fill(authpluginlib);
}
Expand Down Expand Up @@ -177,5 +177,17 @@
await this.page.waitForTimeout(500)
await this.closeEditorButton.click();
}

async fillInstallationPage(DATASET_PREFIX: string, PROC_LIB: string, PARM_LIB: string, ZIS: string, JCL_LIB:string,LOAD_LIB:string,AUTH_LOAD_LIB:string,AUTH_PLUGIN_LIB:string){
await this.page.waitForTimeout(2000);
await this.enterPrefix(DATASET_PREFIX)
await this.enterProcLib(PROC_LIB)
await this.enterParmLib(PARM_LIB)
await this.enterZis(ZIS)
await this.enterJclLib(JCL_LIB)
await this.enterLoadLib(LOAD_LIB)
await this.enterAuthLoadLib(AUTH_LOAD_LIB)
await this.enterAuthPluginLib(AUTH_PLUGIN_LIB)
}
}
export default InstallationPage;
30 changes: 25 additions & 5 deletions playwright_test/Pages/installationType.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page,Locator } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

missing header

class InstallationTypePage{
page: Page;
Expand Down Expand Up @@ -26,7 +26,7 @@
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']")
Expand All @@ -36,6 +36,10 @@
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.continueToUnpax = 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"]')
}

async getInstallationTypePageTitle(){
Expand Down Expand Up @@ -132,19 +136,35 @@
this.selectDownloadZowePax()
this.clickLicenseAgreement()
this.clickAgreeLicense()
}
}

async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any){
this.selectUploadZowePax()
await this.page.waitForTimeout(2000)
await this.uploadPaxButton.setInputFiles(uploadPaxPath)
await this.page.waitForTimeout(2000)
}
}

async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any){
this.selectSmpe()
this.enterRuntimeDir(runtimeDir)
this.clickValidateLocation()
}
}

async clickOnContinueToUnpax(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have a separate page for Unpax, I think we can add all unpax-related stuff under unpax page file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have unpax page as of now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we don't have the page with the title 'Unpax' but on the 'Installation Type' page we are getting the option to 'Continue to Unpax' page, and on that page, we are getting the option 'Skip Unpax' so I think that is a page but it doesn't have the specific title as the title depends on which Installation type we are selecting. So I think if we are following the Page object model then we should add the 'Unpax' page separately. Let me know your thoughts or we can discuss this with our QA team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree as your new PR contains unpax page so will wait for your PR to merge then after that I will fix them after taking pull, because writing same code in two files does not make sense.

this.continueToUnpax.click({ timeout: 2000 })
}

async clickSkipUnpaxButton(){
this.SkipUnpax.click({ timeout: 2000 })
}

async clickRetrieveExZoweYaml(){
this.retrieveExampleZoweYaml.click({ timeout: 15000 })
}

async MoveToInitializationStage(){
this.click_InitializationStage.click({ timeout: 15000 })
}
}
export default InstallationTypePage;
export default InstallationTypePage;
12 changes: 6 additions & 6 deletions playwright_test/Pages/planning.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Locator, Page } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

missing header
let page: Page;

class PlanningPage{
Expand Down Expand Up @@ -45,8 +45,8 @@
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 location')]//following-sibling::div/input")
this.nodeJsLocation = page.locator("//label[contains(text(),'Node.js location')]//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")
Expand Down Expand Up @@ -235,10 +235,10 @@
await this.page.waitForTimeout(500);
await this.jobStatement.fill("//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS=A\n//STEP01 EXEC PGM=IEFBR14\n//SYSPRINT DD SYSOUT=A\n//SYSIN DD DUMMY")
await this.saveAndValidate.click();
await this.page.waitForTimeout(7000);
}
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();
async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, profileIdentifier:any,jobname:any,jobPrefix:any, javaLocation:any,nodejsLocation:any,zOSMFHost:any,zOSMFPort:any,zOSMFAppID:any){
await this.page.waitForTimeout(5000);
await this.enterRuntimeDir(runtimeDir);
await this.enterWorkspaceDir(workspaceDir);
await this.enterLogsDir(logDir);
Expand All @@ -251,7 +251,7 @@
await this.enterZosmfHost(zOSMFHost);
await this.enterZosmfPort(zOSMFPort);
await this.enterZosmfApplicationId(zOSMFAppID);
await this.page.waitForTimeout(2000);
await this.page.waitForTimeout(25000);
}

}
Expand Down
50 changes: 26 additions & 24 deletions playwright_test/Pages/security.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class SecurityPage{
this.licenseAgreement = page.locator('//button[contains(text(), "License Agreement")]')
this.acceptLicense = page.locator('//html/body/div[2]/div[3]/div/div[2]/button[1]')
this.continueToComponentInstallation = page.locator('//button[contains(text(), "Continue to Components Installation")]')
this.mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[3]/div/div[2]/div/div/div'
this.stc_mainXpath = '//html/body/div[1]/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[4]/div/div[2]/div/div/div/'
this.mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[2]/div[1]/div[3]/div/div[2]/div/div/div'
this.stc_mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[2]/div[1]/div[4]/div/div[2]/div/div/div'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using dynamic xpaths which changes frequently

this.product = page.locator('input[role="combobox"]')
this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]')
this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]')
Expand All @@ -59,41 +59,43 @@ 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.click_security = page.locator('//span[text()="Security"]')
this.admin = page.getByLabel('Admin');
this.stc = page.getByLabel('Stc');
this.sys_prog = page.getByLabel('Sys Prog');
this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/div/input');
this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/div/input');
this.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.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');

}

async movetoSecurityPage(){
await this.licenseAgreement.click({timeout: 9000})
await this.acceptLicense.click({timeout: 9000})
await this.continueToComponentInstallation.click({timeout: 5000})
await this.skip_button.click()
await this.skip_button.click()
await this.click_security.click({timeout: 5000})
}
async fillProduct(product:string){
await this.product.fill(product,{ timeout: 10000 })
}
async fillSecurityDetails(product:string, admin:string,stc:string,sys_prog:string,user_zis:string,user_zowe:string,aux: string, stc_zowe: string, stc_zis:string){
await this.product.fill(product,{ timeout: 10000 })
await this.page.waitForTimeout(8000);
await this.admin.fill(admin,{ timeout: 10000 })
await this.stc.fill(stc,{ timeout: 10000 })
await this.sys_prog.fill(sys_prog,{ timeout: 10000 })
await this.page.waitForTimeout(8000);
await this.user_zis.fill(user_zis,{ timeout: 10000 })
await this.user_zowe.fill(user_zowe,{ timeout: 10000 })
await this.page.waitForTimeout(8000);
await this.aux.fill(aux,{ timeout: 10000 })
await this.stc_zowe.fill(stc_zowe,{ timeout: 10000 })
await this.stc_zis.fill(stc_zis,{ timeout: 10000 })
await this.page.waitForTimeout(1000);
await this.product.fill(product)
await this.page.waitForTimeout(1000);
await this.admin.fill(admin)
await this.page.waitForTimeout(1000);
await this.stc.fill(stc);
await this.page.waitForTimeout(1000);
await this.sys_prog.fill(sys_prog)
await this.page.waitForTimeout(1000);
await this.user_zis.fill(user_zis)
await this.page.waitForTimeout(1000);
await this.user_zowe.fill(user_zowe)
await this.page.waitForTimeout(1000);
await this.aux.fill(aux)
await this.page.waitForTimeout(1000);
await this.stc_zowe.fill(stc_zowe)
await this.page.waitForTimeout(1000);
await this.stc_zis.fill(stc_zis)
}

async fillAdmin(admin:string){
Expand Down
Loading
Loading