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

Fix broken github action and improve test logic #238

Merged
merged 7 commits into from
Aug 14, 2024
Merged
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
14 changes: 13 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,20 @@ jobs:
- build-macos
if: ${{ success() && github.event.inputs.PERFORM_RELEASE == 'true' }}
steps:
- name: '[Prep 3] Checkout'
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Set tag value'
run: |
COMMIT_HASH=$(git rev-parse --verify HEAD)
CURRENT_TIME=$(date +%s%3N)
if [ -z ${{ github.event.pull_request.number }} ]
then
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
else
CURRENT_BRANCH=PR-${{ github.event.pull_request.number }}
fi
P_VERSION=$(cat package.json | grep -o '"version": *"[^"]*"' | sed 's/"version": "\(.*\)"/\1/')

- name: '[Release 1] Release (if necessary)'
if: ${{ success() && github.event.inputs.PERFORM_RELEASE == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Zowe",
"description": "Zowe Server Install Wizard",
"productName": "zowe-install-wizard",
"version": "1.0.0",
"version": "1.0.1",
"main": ".webpack/main",
"scripts": {
"start": "electron-forge start --enable-logging",
Expand Down
10 changes: 10 additions & 0 deletions playwright_test/Pages/apfAuth.page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

missing header

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

View workflow job for this annotation

GitHub Actions / lint

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

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

View workflow job for this annotation

GitHub Actions / lint

'electronApp' is defined but never used

class ApfAuthPage{
page: Page;
Expand Down Expand Up @@ -83,6 +83,9 @@
this.dataset_prefix_value = page.getByLabel('Dataset Prefix')
this.auth_load_lib_value = page.getByLabel('APF Authorized Load Library')
this.auth_plugin_lib_value = page.getByLabel('Zowe ZIS Plugins Load Library')

//this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]')
this.select_SMPE = page.locator('span:has-text("SMP/E")');

}
async returnTitleOfApfAuthPage(){
Expand All @@ -93,6 +96,13 @@
async movetoApfAuthPage(){
await this.click_ApfAuth.click({timeout: 9000})
}

async selectInstallationType(){
await this.select_SMPE.waitFor({ state: 'visible', timeout: 9000 }); // Adjust timeout if needed
console.log('SMP/E span is visible.');
await this.select_SMPE.click({timeout: 9000})
}

async movetoInstallationPage(){
await this.licenseAgreement.click({timeout: 9000})
await this.acceptLicense.click({timeout: 9000})
Expand Down
19 changes: 8 additions & 11 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,19 +24,17 @@
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"]')



}
async fillConnectionDetails(host: string, port: string, username: string, password: string){
await this.page.waitForTimeout(1000);
await this.host.fill(host)
console.log("Filling connection details...");
await this.host.fill(host);
await this.page.waitForTimeout(1000);
await this.port.fill(port)
await this.page.waitForTimeout(1000);
await this.userName.fill(username)
await this.page.waitForTimeout(1000);
await this.password.fill(password)
await this.password.fill(password);
console.log("Connection details filled.");
}

async getHostValue(){
Expand All @@ -60,8 +58,10 @@
}

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

async clickContinueButton() {
Expand All @@ -75,12 +75,9 @@
async isContinueButtonVisible() {
return await this.continueButton.isDisabled();
}
async clickContinueButton() {
return await this.continueButton.click();
}
async isGreenCheckIconVisible() {
return await this.greenCheckIconSelector.isHidden();
}
}

export default ConnectionPage;
export default ConnectionPage;
92 changes: 59 additions & 33 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,94 +50,86 @@
return await this.pageTitle.textContent({ timeout: 2000 });
}

async enterPrefix(prefix: any){
async enterPrefix(prefix: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.prefix.fill(prefix);
}

async getPrefixValue(){
await this.page.waitForTimeout(500)
return await this.prefix.textContent();
async getPrefixValue(): Promise<string> {
return await this.prefix.inputValue();
}

async enterProcLib(proclib: any){
async enterProcLib(proclib: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.procLib.fill(proclib);
}

async getProclibValue(){
await this.page.waitForTimeout(500)
return await this.procLib.textContent();

async getProclibValue(): Promise<string> {
return await this.procLib.inputValue();
}

async enterParmLib(parmlib: any){
async enterParmLib(parmlib: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.parmLib.fill(parmlib);
}

async getParmlibValue(){
await this.page.waitForTimeout(500)
return await this.parmLib.textContent();
async getParmlibValue(): Promise<string> {
return await this.parmLib.inputValue();
}

async enterZis(zis: any){
async enterZis(zis: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.zis.fill(zis);
}

async enterJclLib(Jcllib: any){
async enterJclLib(Jcllib: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.jclLib.fill(Jcllib);
}

async enterLoadLib(loadlib: any){
async enterLoadLib(loadlib: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.loadLib.fill(loadlib);
}

async enterAuthLoadLib(authloadlib: any){
await this.page.waitForTimeout(500)
async enterAuthLoadLib(authloadlib: string): Promise<void> {
await this.authLoadLib.fill(authloadlib);
await this.page.waitForTimeout(5000)
}

async getAuthLoadLibValue(){
await this.page.waitForTimeout(500)
return await this.authLoadLib.textContent();
async getAuthLoadLibValue(): Promise<string> {
return await this.authLoadLib.inputValue();
}

async enterAuthPluginLib(authpluginlib: any){
await this.page.waitForTimeout(500)
async enterAuthPluginLib(authpluginlib: string): Promise<void> {
await this.authPluginLib.fill(authpluginlib);
await this.page.waitForTimeout(5000)
}

async getAuthPluginLibValue(){
await this.page.waitForTimeout(500)
return await this.authPluginLib.textContent();
async getAuthPluginLibValue(): Promise<string> {
return await this.authPluginLib.inputValue();
}

async clickInstallMvsDatasets(){
await this.page.waitForTimeout(1000)
await this.installMVSDatasets.click();
await this.installMVSDatasets.click();
await this.waitForContinueButtonToBeEnabled();
}

async clickViewEditYaml(){
await this.page.waitForTimeout(500)
await this.viewEditYaml.click();
}

async clickViewSubmitJob(){
await this.page.waitForTimeout(500)
await this.viewSubmitJob.click();
}

async clickViewJobOutput(){
await this.page.waitForTimeout(500)
await this.viewJobOutput.click();
await this.page.waitForTimeout(2000);
}

async clickSaveAndClose(){
await this.page.waitForTimeout(500)
await this.saveAndClose.click({timeout: 2000});
}

Expand All @@ -157,14 +149,30 @@
}

async isContinueToNetworkSetupDisabled(){
await this.page.waitForTimeout(500)
return await this.continueToNetworkSetup.isDisabled()
}

async isContinueToNetworkSetupEnabled(){
await this.page.waitForTimeout(500)
return await this.continueToNetworkSetup.isEnabled()
}

async isSkipToNetworkSetupEnabled(){
return await this.skipInstallation.isEnabled()
}

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

throw new Error('Continue button was not enabled within the timeout period');
}

async open_monacoEditor(){
await this.page.waitForTimeout(1000)
Expand All @@ -177,5 +185,23 @@
await this.page.waitForTimeout(500)
await this.closeEditorButton.click();
}

async clickInstallMvsDatasetsInvalid(){
await this.installMVSDatasets.click();
}

async fillAllFields(datasetPrefix: string, parmLib: string, procLib: string, jclLib: string, loadLib: string, authLoadLib: string, authPluginLib: string){
await this.enterPrefix(datasetPrefix);
await this.enterParmLib(parmLib);
await this.enterProcLib(procLib);
await this.enterJclLib(jclLib);
await this.enterLoadLib(loadLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
}
}
export default InstallationPage;
Loading
Loading