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 workspace creation and debug profiles for devsandbox periodic tests #20141

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
19 changes: 16 additions & 3 deletions tests/e2e/pageobjects/dashboard/CreateWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import { injectable, inject } from 'inversify';
import { CLASSES } from '../../inversify.types';
import { DriverHelper } from '../../utils/DriverHelper';
import { By } from 'selenium-webdriver';
import { By, error } from 'selenium-webdriver';
import { Logger } from '../../utils/Logger';
import { TimeoutConstants } from '../../TimeoutConstants';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';

@injectable()
export class CreateWorkspace {
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) { }

async waitTitleContains(expectedText: string, timeout: number = TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT) {
Logger.debug(`CreateWorkspace.waitTitleContains text: "${expectedText}"`);
Expand Down Expand Up @@ -46,7 +48,18 @@ export class CreateWorkspace {

const sampleLocator: By = this.getSampleLocator(sampleName);

await this.driverHelper.waitAndClick(sampleLocator, timeout);
try {
await this.driverHelper.waitAndClick(sampleLocator, timeout);
ScrewTSW marked this conversation as resolved.
Show resolved Hide resolved
} catch (err) {
if (err instanceof error.StaleElementReferenceError) {
// for CRW 2.9.x create workspace sometimes fails with StakeElementReferenceError
// causing the tests to fail to create a workspace, when the dashboard is only
// partially initialized. Refreshing page and trying to click on workspace again.
await this.browserTabsUtil.refreshPage();
await this.waitPage();
await this.driverHelper.waitAndClick(sampleLocator, timeout);
}
}
}

private getSampleLocator(sampleName: string): By {
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/testsLibrary/LanguageServerTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export class LanguageServerTests {

test('Run debug', async () => {
await this.debugView.clickOnDebugConfigurationDropDown();
// workaround for debug configuration not present
await this.debugView.clickOnDebugConfigurationItem('Add Configuration...');
await this.debugView.clickOnDebugConfigurationDropDown();
// ===
Copy link
Contributor

Choose a reason for hiding this comment

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

In my eyes, this is extra. I would suggest to leave just empty row.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the way the fix was implemented in your PR, instead of doing the refresh and it fixed our problems when I tried it from a custom-built dockerimage

await this.debugView.clickOnDebugConfigurationItem(configurationName);
await this.debugView.clickOnRunDebugButton();
});
Expand Down