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

WIP: Feature implement python devfile #15736

Closed

Conversation

ScrewTSW
Copy link
Member

What does this PR do?

  • fixes Ide.closeAllNotifications method which was not functional, replacing the logic with use of NotificationCenter instead
  • adds a new method Ide.waitDialogShell into the Ide class which allows handling of the full-screen notification overlays
  • adds runTaskWithDialogShell method into the common class which handles tasks that don't have an exit code toast displayed after they're executed (namely webserver containing devfiles)
  • adds a new Python Django devfile test
  • fixes some small typos

What issues does this PR fix or reference?

#15735

@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

Can one of the admins verify this patch?

1 similar comment
@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

Can one of the admins verify this patch?

@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Jan 17, 2020
@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch 3 times, most recently from c4a8020 to 76c0fee Compare January 17, 2020 11:33
@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@rhopp
Copy link
Contributor

rhopp commented Jan 17, 2020

ci-test

@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

⚠️ https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 17, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

Copy link
Contributor

@Ohrimenko1988 Ohrimenko1988 left a comment

Choose a reason for hiding this comment

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

Please rewrite your test methods by using the "DriverHelper" class.

Copy link
Contributor

@Katka92 Katka92 left a comment

Choose a reason for hiding this comment

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

Adding the fist part of the review. I'll continue on Monday.

tests/e2e/mocha-python-django.opts Show resolved Hide resolved
tests/e2e/tests/devfiles/PythonDjango.spec.ts Outdated Show resolved Hide resolved
tests/e2e/pageobjects/ide/Ide.ts Outdated Show resolved Hide resolved
tests/e2e/pageobjects/ide/Ide.ts Outdated Show resolved Hide resolved
@che-bot
Copy link
Contributor

che-bot commented Jan 20, 2020

E2E tests of Eclipse Che Multiuser on OCP has failed:

Copy link
Contributor

@Katka92 Katka92 left a comment

Choose a reason for hiding this comment

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

Maybe it would be good trying to simplify locators using this approach: https://github.com/eclipse/che/blob/master/tests/e2e/pageobjects/ide/DebugView.ts#L33 - I mean using contains for some important class instead of directly specifying all classes by @class.

tests/e2e/testsLibrary/CodeExecutionTests.ts Outdated Show resolved Hide resolved
tests/e2e/pageobjects/ide/Ide.ts Outdated Show resolved Hide resolved
tests/e2e/pageobjects/ide/Ide.ts Outdated Show resolved Hide resolved
@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch 2 times, most recently from 63079ff to 6361103 Compare January 21, 2020 15:13
@che-bot
Copy link
Contributor

che-bot commented Jan 21, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

⚠️ https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

timeout: number = TestConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT) {

async waitWorkspaceAndIde(workspaceNamespace: string, workspaceName: string, timeout: number = TestConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT) {
// why are there unused arguments in this method?
Copy link
Member Author

Choose a reason for hiding this comment

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

We should consider refactoring this method. It's tied to HappyPath tests as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from 6361103 to 1e8e2e0 Compare January 22, 2020 08:46
@che-bot
Copy link
Contributor

che-bot commented Jan 22, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from 1e8e2e0 to ec051a0 Compare January 22, 2020 14:58
@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch 2 times, most recently from 20e279e to 3c7a54d Compare January 22, 2020 15:08
@eclipse-che eclipse-che deleted a comment from che-bot Jan 22, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Jan 22, 2020
@che-bot
Copy link
Contributor

che-bot commented Jan 22, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from 3c7a54d to dcf6901 Compare January 23, 2020 15:27
@che-bot
Copy link
Contributor

che-bot commented Jan 23, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

⚠️ https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from dcf6901 to 920a177 Compare January 23, 2020 16:29
@che-bot
Copy link
Contributor

che-bot commented Jan 23, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@@ -45,8 +43,6 @@ export class TopMenu {
Logger.debug(`TopMenu.clickOnTopMenuButton "${buttonText}"`);

const buttonLocator: By = this.getTopMenuButtonLocator(buttonText);

await this.ide.closeAllNotifications();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain a reason why you deleted this method

Copy link
Member Author

@ScrewTSW ScrewTSW Jan 24, 2020

Choose a reason for hiding this comment

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

It makes absolutely no sense to close notifications after clicking the top menu item and it was stealing focus from the Terminal element causing the windows to close since the method closeAllNotifications is performing clicks.

If you want to make sure there are no notifications present, you should call it in your tests separately before you call TopMenu.clickOnTopMenuButton

I've discussed it with @Katka92 and @rhopp and they agreed

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't make sense if notifications appear at the bottom left corner. as now But this method was put there when notifications appeared at the top center and override the top menu. Can you guarantee that it will not be there again for example tomorrow?

export function runTaskWithDialogShellAndOpenLink(taskName: string, expectedDialogText: string, timeout: number) {
test(`Run command '${taskName}' expecting dialog shell`, async () => {
await topMenu.runTask(taskName);
await dialogWindow.waitDialog(timeout, expectedDialogText);
Copy link
Contributor

Choose a reason for hiding this comment

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

replace

        await dialogWindow.waitDialog(timeout, expectedDialogText);
        await dialogWindow.clickToButton(dialogWindowOpenLinkButtonText);
        await dialogWindow.waitDialogDissappearance();

by

await dialogWindow.waitDialogAndOpenLink(timeout, expectedDialogText);

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/eclipse/che/blob/master/tests/e2e/pageobjects/ide/DialogWindow.ts#L79 this and the method above it seem to be in an incorrect order

Copy link
Member Author

Choose a reason for hiding this comment

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

I've fixed the method:
From:

        await this.ide.waitApllicationIsReady(await this.getApplicationUrlFromDialog(dialogText), timeout);
        await this.clickToOpenLinkButton();

To:

        const applicationUrlFromDialog: string = await this.getApplicationUrlFromDialog(dialogText);
        await this.clickToOpenLinkButton();
        await this.ide.waitApllicationIsReady(applicationUrlFromDialog, timeout);

This resolved the race condition

@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from 920a177 to 8dfbb3d Compare January 24, 2020 13:25
… added new runTaskWithDialogShell method into testsLibrary/CodeExecutionTests

Signed-off-by: Tibor Dancs <tdancs@redhat.com>
Signed-off-by: Tibor Dancs <tdancs@redhat.com>
@ScrewTSW ScrewTSW force-pushed the feature-implement-python-devfile branch from 8dfbb3d to 44e9f6c Compare January 24, 2020 13:48
@che-bot
Copy link
Contributor

che-bot commented Jan 24, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@ScrewTSW ScrewTSW changed the title Feature implement python devfile WIP: Feature implement python devfile Jan 24, 2020
@che-bot
Copy link
Contributor

che-bot commented Jan 24, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@ScrewTSW
Copy link
Member Author

Closing. The PR was split into two separate PRs and cross-referenced:
#15830
#15831

@@ -521,6 +522,32 @@ export class DriverHelper {
throw new error.TimeoutError(`Exceeded maximum mouse move attempts, for the '${elementLocator}' element`);
}

public async hasChildren(elementLocator: By): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can suggest other variant:

    public async hasChildren(elementXpathLocator: String): Promise<boolean> {
        return await this.isVisible(By.xpath(`${elementXpathLocator}//*`));
    }

For me looks much simplier

@@ -45,8 +43,6 @@ export class TopMenu {
Logger.debug(`TopMenu.clickOnTopMenuButton "${buttonText}"`);

const buttonLocator: By = this.getTopMenuButtonLocator(buttonText);

await this.ide.closeAllNotifications();
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't make sense if notifications appear at the bottom left corner. as now But this method was put there when notifications appeared at the top center and override the top menu. Can you guarantee that it will not be there again for example tomorrow?

tests/e2e/pageobjects/ide/Ide.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants