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

Selenium: adapt dashboard selenium tests for OSIO #9448

Merged
merged 15 commits into from
Apr 23, 2018

Conversation

SkorikSergey
Copy link
Contributor

@SkorikSergey SkorikSergey commented Apr 16, 2018

What does this PR do?

This PR adapt selenium test from dashboard package for OSIO.

What issues does this PR fix or reference?

#9455

Host to run Che 6 on OSIO: https://rhche.prod-preview.openshift.io

For example, the command to run Dashboard related tests on https://rhche.prod-preview.openshift.io from the che/selenium/che-selenium-test directory:
export CHE_INFRASTRUCTURE=openshift \
&& export CHE_TESTUSER_NAME='<username>' \
&& export CHE_TESTUSER_EMAIL='<user-email>' \
&& export CHE_TESTUSER_PASSWORD='<password>' \
&& export CHE_TESTUSER_OFFLINE__TOKEN=<offline-token> \
&& export CHE_OFFLINE_TO_ACCESS_TOKEN_EXCHANGE_ENDPOINT=https://auth.prod-preview.openshift.io/api/token/refresh \
&& ./selenium-tests.sh --test=org.eclipse.che.selenium.dashboard.** --host=rhche.prod-preview.openshift.io --https --port=443 -Dgroups=osio --multiuser --threads=1

@SkorikSergey SkorikSergey added status/in-progress This issue has been taken by an engineer and is under active development. kind/task Internal things, technical debt, and to-do tasks to be performed. team/che-qe labels Apr 16, 2018
@SkorikSergey
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9448
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@SkorikSergey
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9448
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@@ -155,6 +158,7 @@ public void shouldCreatingFactoryFromWorkspace() {
createFactoryPage.clickOnSourceTab(WORKSPACE_TAB_ID);
createFactoryPage.typeFactoryName(FACTORY_CREATED_FROM_WORKSPACE_NAME);
createFactoryPage.clickOnWorkspaceFromList(WORKSPACE_NAME);
WaitUtils.sleepQuietly(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, comment why we need sleep here.


public void waitToastLoaderAndClickButton(String buttonName) {
projectExplorer.waitProjectExplorer();
WaitUtils.sleepQuietly(5);
Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 19, 2018

Choose a reason for hiding this comment

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

It's better to use helper method SeleniumWebDriverHelper#waitInvisibility(WebElement webElement, int timeout) and handle TimeoutException by calling clickOnToastLoaderButton(buttonName) method to shorten 5 seconds timeout.
It also requires clear documentation on this method.

@@ -85,6 +90,7 @@ public void createAndDeleteProjectTest() throws ExecutionException, InterruptedE
newWorkspace.clickOnCreateButtonAndOpenInIDE();

String dashboardWindow = seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
toastLoader.waitToastLoaderAndClickButton("Start");
Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 19, 2018

Choose a reason for hiding this comment

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

IMHO we can involve separate method waitToastLoaderAndClickStartButton() to leave list of arguments an empty.

@@ -196,9 +200,9 @@ private void createWorkspaceWithProject(String workspaceName) {
workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
loader.waitOnClosed();
newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, comment on why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@@ -67,6 +70,10 @@ public void waitToastLoaderIsOpen() {
seleniumWebDriverHelper.waitVisibility(mainForm, UPDATING_PROJECT_TIMEOUT_SEC);
}

public Boolean isToastLoaderIsOpened() {
Copy link
Contributor

Choose a reason for hiding this comment

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

correct name is isToastLoaderOpened

@@ -76,6 +80,7 @@ public void createAndDeleteProjectTest() throws ExecutionException, InterruptedE
workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();

newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@@ -133,13 +133,13 @@ public void checkFiltersStacksFeature() {
newWorkspace.clickOnMultiMachineTab();
assertFalse(newWorkspace.isStackVisible(JAVA.getId()));

// filter stacks by 'php' value and check filtered stacks list
// filter stacks by 'blank' value and check filtered stacks list
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we need to user blank stack name

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

We used here Blank stack because PHP stack not exist on OSIO.

@@ -61,6 +66,7 @@ public void checkAbilityImportMavenProjectTest() throws ExecutionException, Inte

workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@@ -81,6 +85,7 @@ public void checkAbilityImportProjectFromGithub() throws Exception {
dashboard.selectWorkspacesItemOnDashboard();
workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@@ -61,6 +66,7 @@ public void importProjectFromZipTest() throws ExecutionException, InterruptedExc

workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@@ -215,6 +216,7 @@ private void createWorkspace(String name) {

workspaces.clickOnAddWorkspaceBtn();
newWorkspace.waitToolbar();
newWorkspace.clickOnAllStacksTab();
Copy link
Contributor

Choose a reason for hiding this comment

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

please, leave comment about why we can't rely on Quick Start stack list.

Copy link
Contributor Author

@SkorikSergey SkorikSergey Apr 19, 2018

Choose a reason for hiding this comment

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

The Java stack, which we use for creating test workspaces, not exist in Quick Start stacks list on OSIO.

@SkorikSergey SkorikSergey added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Apr 19, 2018
@SkorikSergey
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9448
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@dmytro-ndp
Copy link
Contributor

Could you, please, leave command to start OSIO specific tests in description to this PR?

@SkorikSergey SkorikSergey merged commit 781dc58 into master Apr 23, 2018
@SkorikSergey SkorikSergey deleted the reworkDashboardTestsForOSIO branch April 23, 2018 10:58
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Apr 23, 2018
@benoitf benoitf added this to the 6.5.0 milestone Apr 23, 2018
hbhargav pushed a commit to hbhargav/che that referenced this pull request Dec 5, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants