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: add method for switching from Dashboard to IDE frame in SeleniumWebDriverHelper class #9262

Merged
merged 17 commits into from
Apr 4, 2018

Conversation

SkorikSergey
Copy link
Contributor

What does this PR do?

This PR adds switchFromDashboardAndWaitProjectExplorer method for switching from Dashboard to IDE frame in SeleniumWebDriverHelper class.

What issues does this PR fix or reference?

#9100

@SkorikSergey SkorikSergey 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. team/che-qe labels Mar 27, 2018
@@ -57,6 +58,7 @@
@Inject private Dashboard dashboard;
@Inject private WorkspaceDetails workspaceDetails;
@Inject private SeleniumWebDriver seleniumWebDriver;
Copy link
Contributor

Choose a reason for hiding this comment

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

seleniumWebDriver looks redundant in class.

@@ -44,6 +45,7 @@
private String gitHubUsername;

@Inject private SeleniumWebDriver seleniumWebDriver;
Copy link
Contributor

Choose a reason for hiding this comment

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

seleniumWebDriver looks redundant in class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SeleniumWebDriver is needed in some factory tests for factory url opening(TestFactory.open(seleniumWebDriver)).

Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 4, 2018

Choose a reason for hiding this comment

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

Looks like an issue. It seems we can easily reuse field TestFactory#seleniumWebDriver inside the open() method instead of argument seleniumWebDriver.

@@ -85,7 +87,7 @@ public void checkOpenFileFeatureTest() throws Exception {
String currentWin = seleniumWebDriver.getWindowHandle();
seleniumWebDriver.switchToNoneCurrentWindow(currentWin);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move SeleniumWebDriver#switchToNoneCurrentWindow(currentWin) method to the SeleniumWebDriverHelper as well, can't we?

@dmytro-ndp
Copy link
Contributor

SeleniumWebDriver seleniumWebDriver; field becomes redundant in the most test classes after refactoring. Please, remove such fields.

@dmytro-ndp
Copy link
Contributor

It worth to move SeleniumWebDriver#switchToNoneCurrentWindow(currentWin) method to the SeleniumWebDriverHelper class as well.

@@ -766,4 +768,21 @@ public void waitAndSwitchToFrame(WebElement frame, int timeout) {
public void waitAndSwitchToFrame(WebElement frame) {
waitAndSwitchToFrame(frame, DEFAULT_TIMEOUT);
}

/** Switch to IDE frame and wait that Project Explorer is visible */
public void switchFromDashboardAndWaitProjectExplorer() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please create an override of this method with a custom timeout in argument

public void switchFromDashboardAndWaitProjectExplorer(int timeout)

@@ -766,4 +768,21 @@ public void waitAndSwitchToFrame(WebElement frame, int timeout) {
public void waitAndSwitchToFrame(WebElement frame) {
waitAndSwitchToFrame(frame, DEFAULT_TIMEOUT);
}

/** Switch to IDE frame and wait that Project Explorer is visible */
Copy link
Contributor

Choose a reason for hiding this comment

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

Switch -> Switches ; wait -> waits

@@ -766,4 +768,21 @@ public void waitAndSwitchToFrame(WebElement frame, int timeout) {
public void waitAndSwitchToFrame(WebElement frame) {
waitAndSwitchToFrame(frame, DEFAULT_TIMEOUT);
}

/** Switch to IDE frame and wait that Project Explorer is visible */
public void switchFromDashboardAndWaitProjectExplorer() {
Copy link
Contributor

@Ohrimenko1988 Ohrimenko1988 Mar 28, 2018

Choose a reason for hiding this comment

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

And about method name. What do you think about

switchToIdeFrameAndWaitAvailability

@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:9262
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:9262
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:9262
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

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

String dashboardWindow = seleniumWebDriver.getWindowHandle();
Copy link
Contributor

Choose a reason for hiding this comment

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

We could rework seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability() to return dashboardWindow

*
* @param currentWindowHandler
*/
public void switchToNoneCurrentWindow(String currentWindowHandler) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 2, 2018

Choose a reason for hiding this comment

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

Let's rename the method to make its propose more obvious: switchToNextWindow().
Argument currentWindowHandler is also misleading so as it seems could be any non-current window handler. So, lets rename the argument to be more precise, for example: windowHandlerToSwitchFrom.

@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:9262
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@SkorikSergey SkorikSergey merged commit 219802a into master Apr 4, 2018
@SkorikSergey SkorikSergey deleted the switchFromDashboardToIdeFrame branch April 4, 2018 13:37
@SkorikSergey SkorikSergey 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 4, 2018
@benoitf benoitf added this to the 6.4.0 milestone Apr 4, 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.

5 participants