Skip to content
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
2 changes: 1 addition & 1 deletion tests/e2e/pageobjects/dashboard/CreateWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class CreateWorkspace {
private getSampleLocator(sampleName: string): By {
Logger.trace(`sampleName: ${sampleName}, used default editor`);

return By.xpath(`//article[contains(@class, 'sample-card')]//div[text()='${sampleName}']`);
return By.xpath(`//div[contains(@id, 'sample-card') and text()='${sampleName}']`);
}

private getGitBranchListItemLocator(branchName: string): By {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/pageobjects/dashboard/TrustAuthorPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** *******************************************************************
* copyright (c) 2019-2023 Red Hat, Inc.
* copyright (c) 2019-2026 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -17,7 +17,7 @@ import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';

@injectable()
export class TrustAuthorPopup {
private static readonly CONTINUE_BUTTON: By = By.xpath('//button[text()="Continue"]');
private static readonly CONTINUE_BUTTON: By = By.xpath('//span[text()="Continue"]');
private static readonly TRUST_AUTHOR_POPUP_PAGE: By = By.xpath(
'//span[contains(text(), "Do you trust the authors of this repository?")]'
);
Expand Down
27 changes: 14 additions & 13 deletions tests/e2e/pageobjects/dashboard/Workspaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** *******************************************************************
* copyright (c) 2019-2023 Red Hat, Inc.
* copyright (c) 2019-2026 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -22,11 +22,12 @@ export enum WorkspaceStatusUI {

@injectable()
export class Workspaces {
private static readonly ADD_WORKSPACE_BUTTON: By = By.xpath('//button[text()="Add Workspace"]');
private static readonly ADD_WORKSPACE_BUTTON: By = By.css('button[aria-label="Add Workspace"]');
private static readonly WORKSPACE_ITEM_TABLE_NAME_SECTION: By = By.xpath('//td[@data-label="Name"]/span/a');
private static readonly DELETE_WORKSPACE_BUTTON_ENABLED: By = By.xpath(
'//button[@data-testid="delete-workspace-button" and not(@disabled)]'
);
private static readonly WORKSPACE_ACTION_POPUP: By = By.css('div[class*="workspaceActionSelector"]');
private static readonly DELETE_CONFIRMATION_CHECKBOX: By = By.xpath('//input[@data-testid="confirmation-checkbox"]');
private static readonly CONFIRMATION_WINDOW: By = By.xpath('//div[@aria-label="Delete workspaces confirmation window"]');
private static readonly LEARN_MORE_DOC_LINK: By = By.xpath('//div/p/a');
Expand Down Expand Up @@ -99,7 +100,7 @@ export class Workspaces {
async waitActionsPopup(workspaceName: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise<void> {
Logger.debug(`of the '${workspaceName}' list item`);

await this.driverHelper.waitVisibility(this.getExpandedActionsLocator(workspaceName), timeout);
await this.driverHelper.waitVisibility(Workspaces.WORKSPACE_ACTION_POPUP, timeout);
}

async openActionsPopup(workspaceName: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise<void> {
Expand All @@ -112,19 +113,19 @@ export class Workspaces {
async clickActionsDeleteButton(workspaceName: string): Promise<void> {
Logger.debug(`for the '${workspaceName}' list item`);

await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Delete Workspace'));
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Delete Workspace'));
}

async clickActionsStopWorkspaceButton(workspaceName: string): Promise<void> {
Logger.debug(`for the '${workspaceName}' list item`);
// todo: workaround because of issue CRW-3649
try {
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Stop Workspace'));
} catch (e) {
Logger.warn(`for the '${workspaceName}' list item - popup was missed, try to click one more time (issue CRW-3649).`);

await this.driverHelper.waitAndClick(this.getActionsLocator(workspaceName));
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Stop Workspace'));
}
}

Expand Down Expand Up @@ -214,7 +215,7 @@ export class Workspaces {
}

private getWorkspaceListItemLocator(workspaceName: string): By {
return By.xpath(`//tr[td//a[text()='${workspaceName}']]`);
return By.xpath(`//tr[td//span[text()='${workspaceName}']]`);
}

private getWorkspaceStatusLocator(workspaceName: string, workspaceStatus: WorkspaceStatusUI): By {
Expand All @@ -226,21 +227,21 @@ export class Workspaces {
}

private getActionsLocator(workspaceName: string): By {
return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}/td/div/button[@aria-label='Actions']`);
return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}/td/button[@aria-label='Actions']`);
}

private getExpandedActionsLocator(workspaceName: string): By {
/* private getExpandedActionsLocator(workspaceName: string): By {
return By.xpath(
`${this.getWorkspaceListItemLocator(workspaceName).value}//button[@aria-label='Actions' and @aria-expanded='true']`
);
}
}*/

private getActionsPopupButtonLocator(workspaceName: string, buttonText: string): By {
return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//button[text()='${buttonText}']`);
private getActionsPopupButtonLocator(buttonText: string): By {
return By.css(`button[aria-label="Action: ${buttonText}"]`);
}

private getOpenButtonLocator(workspaceName: string): By {
return By.xpath(`(${this.getWorkspaceListItemLocator(workspaceName).value}//td//button[text()='Open'])[last()]`);
return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//td[contains(@class, 'openIde')]//span[text()='Open']`);
}

private getOpenWorkspaceDetailsLinkLocator(workspaceName: string): By {
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/tests-library/WorkspaceHandlingTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** *******************************************************************
* copyright (c) 2019-2023 Red Hat, Inc.
* copyright (c) 2019-2026 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -23,9 +23,9 @@ import { By, error } from 'selenium-webdriver';
@injectable()
export class WorkspaceHandlingTests {
private static WORKSPACE_NAME: By = By.xpath('//h1[contains(.,"Starting workspace ")]');
private static WORKSPACE_STATUS: By = By.xpath('//*/span[@class="pf-c-label__content"]');
private static WORKSPACE_ALERT_TITLE: By = By.xpath('//h4[@class="pf-c-alert__title"]');
private static WORKSPACE_ALERT_DESCRIPTION: By = By.xpath('//*/div[@class="pf-c-alert__description"]');
private static WORKSPACE_STATUS: By = By.css('span[class*="label__content"]');
private static WORKSPACE_ALERT_TITLE: By = By.css('h4[class*="alert__title"]');
private static WORKSPACE_ALERT_DESCRIPTION: By = By.css('div[class*="alert__description"]');
private static workspaceName: string = 'undefined';
private static parentGUID: string;

Expand Down
Loading