diff --git a/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts b/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts index 51a7203e3b9..62af081e639 100644 --- a/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts +++ b/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts @@ -40,6 +40,9 @@ export class CheCodeLocatorLoader extends LocatorLoader { WelcomeContent: { text: By.xpath('//*[@class="dialog-message-text" and contains(text(), "trust")]'), button: By.xpath('//div[@class="monaco-dialog-box"]//a[@class="monaco-button monaco-text-button"]') + }, + ScmView: { + actionConstructor: (title: string) => By.xpath(`.//a[@title='${title}']`) } }, extras: { diff --git a/tests/e2e/specs/factory/Factory.spec.ts b/tests/e2e/specs/factory/Factory.spec.ts index f5af702f421..fda655ff467 100644 --- a/tests/e2e/specs/factory/Factory.spec.ts +++ b/tests/e2e/specs/factory/Factory.spec.ts @@ -25,6 +25,7 @@ import { import { expect } from 'chai'; import { OauthPage } from '../../pageobjects/git-providers/OauthPage'; import { StringUtil } from '../../utils/StringUtil'; +import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader'; import { registerRunningWorkspace } from '../MochaHooks'; import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; @@ -45,7 +46,8 @@ suite( const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); - const webCheCodeLocators: Locators = e2eContainer.get(CLASSES.CheCodeLocatorLoader); + const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader); + const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators; const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage); let projectSection: ViewSection; @@ -106,7 +108,7 @@ suite( test('Make changes to the file', async function (): Promise { Logger.debug(`projectSection.openItem: "${fileToChange}"`); - await projectSection.openItem(fileToChange); + await projectSection.openItem(testRepoProjectName, fileToChange); const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor; await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea); Logger.debug('editor.clearText'); @@ -184,7 +186,7 @@ suite( webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel), 'aria-disabled' ); - expect(isCommitButtonDisabled).to.be.true; + expect(isCommitButtonDisabled).to.equal('true'); }); test('Stop the workspace', async function (): Promise { diff --git a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts index ca0f30d8baf..21d943327be 100644 --- a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts +++ b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts @@ -41,12 +41,13 @@ import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS'; import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS'; suite( - `Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`, + `Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without PAT/OAuth setup`, function (): void { const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); - const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators; + const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader); + const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators; const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces); @@ -127,7 +128,7 @@ suite( test('Make changes to the file', async function (): Promise { Logger.debug(`projectSection.openItem: "${fileToChange}"`); - await projectSection.openItem(fileToChange); + await projectSection.openItem(testRepoProjectName, fileToChange); const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor; await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea); Logger.debug('editor.clearText'); diff --git a/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts b/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts index 4a0bf2ba649..27967ce3f67 100644 --- a/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts +++ b/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts @@ -45,7 +45,8 @@ suite( const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); - const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators; + const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader); + const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators; const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage); @@ -125,7 +126,7 @@ suite( test('Make changes to the file', async function (): Promise { Logger.debug(`projectSection.openItem: "${fileToChange}"`); - await projectSection.openItem(fileToChange); + await projectSection.openItem(testRepoProjectName, fileToChange); const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor; await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea); Logger.debug('editor.clearText');