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

Update E2E 'factory' tests according new UI changes #22588

Merged
merged 5 commits into from
Oct 11, 2023
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
3 changes: 3 additions & 0 deletions tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}']`)
nallikaea marked this conversation as resolved.
Show resolved Hide resolved
}
},
extras: {
Expand Down
8 changes: 5 additions & 3 deletions tests/e2e/specs/factory/Factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -106,7 +108,7 @@ suite(

test('Make changes to the file', async function (): Promise<void> {
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');
Expand Down Expand Up @@ -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<void> {
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -127,7 +128,7 @@ suite(

test('Make changes to the file', async function (): Promise<void> {
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');
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -125,7 +126,7 @@ suite(

test('Make changes to the file', async function (): Promise<void> {
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');
Expand Down
Loading