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

Fix AskDialog page object of selenium tests #9745

Merged
merged 1 commit into from
May 18, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public SeleniumWebDriverHelper(
*/
public void setValue(By elementLocator, String value) {
waitVisibility(elementLocator).clear();
waitValue(elementLocator, "");
waitValueEqualsTo(elementLocator, "");
waitAndSendKeysTo(elementLocator, value);
waitValue(elementLocator, value);
waitValueEqualsTo(elementLocator, value);
}

/**
Expand All @@ -85,9 +85,9 @@ public void setValue(By elementLocator, String value) {
*/
public void setValue(WebElement webElement, String value) {
waitVisibility(webElement).clear();
waitValue(webElement, "");
waitValueEqualsTo(webElement, "");
waitAndSendKeysTo(webElement, value);
waitValue(webElement, value);
waitValueEqualsTo(webElement, value);
}

/**
Expand All @@ -100,9 +100,9 @@ public void setValue(WebElement webElement, String value) {
*/
public void setText(By elementLocator, String value) {
waitVisibility(elementLocator).clear();
waitText(elementLocator, "");
waitTextEqualsTo(elementLocator, "");
waitAndSendKeysTo(elementLocator, value);
waitText(elementLocator, value);
waitTextEqualsTo(elementLocator, value);
}

/**
Expand All @@ -115,9 +115,9 @@ public void setText(By elementLocator, String value) {
*/
public void setText(WebElement webElement, String value) {
waitVisibility(webElement).clear();
waitText(webElement, "");
waitTextEqualsTo(webElement, "");
waitAndSendKeysTo(webElement, value);
waitText(webElement, value);
waitTextEqualsTo(webElement, value);
}

/**
Expand Down Expand Up @@ -489,14 +489,14 @@ public String waitVisibilityAndGetText(WebElement webElement) {

/**
* Waits during {@code timeout} until text extracted from {@link WebElement} with specified {@code
* elementLocator} by {@link WebElement#getAttribute(String)} is equivalent to provided {@code
* elementLocator} by {@link WebElement#getAttribute(String)} equals to provided {@code
* expectedValue}.
*
* @param elementLocator locator of element in which text should be checked
* @param expectedValue expected text which should be present in the element
* @param timeout waiting time in seconds
*/
public void waitValue(By elementLocator, String expectedValue, int timeout) {
public void waitValueEqualsTo(By elementLocator, String expectedValue, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -506,24 +506,24 @@ public void waitValue(By elementLocator, String expectedValue, int timeout) {

/**
* Waits until text extracted from {@link WebElement} with specified {@code elementLocator} by
* {@link WebElement#getAttribute(String)} is equivalent to provided {@code expectedValue}.
* {@link WebElement#getAttribute(String)} equals to provided {@code expectedValue}.
*
* @param elementLocator locator of element in which text should be checked
* @param expectedValue expected text which should be present in the element
*/
public void waitValue(By elementLocator, String expectedValue) {
waitValue(elementLocator, expectedValue, DEFAULT_TIMEOUT);
public void waitValueEqualsTo(By elementLocator, String expectedValue) {
waitValueEqualsTo(elementLocator, expectedValue, DEFAULT_TIMEOUT);
}

/**
* Waits during {@code timeout} until text extracted from specified {@code webElement} by {@link
* WebElement#getAttribute(String)} is equivalent to provided {@code expectedValue}.
* WebElement#getAttribute(String)} equals to provided {@code expectedValue}.
*
* @param webElement element in which text should be checked
* @param expectedValue expected text which should be present in the element
* @param timeout waiting time in seconds
*/
public void waitValue(WebElement webElement, String expectedValue, int timeout) {
public void waitValueEqualsTo(WebElement webElement, String expectedValue, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -533,13 +533,13 @@ public void waitValue(WebElement webElement, String expectedValue, int timeout)

/**
* Waits until text extracted from specified {@code webElement} by {@link
* WebElement#getAttribute(String)} is equivalent to provided {@code expectedValue}.
* WebElement#getAttribute(String)} equals to provided {@code expectedValue}.
*
* @param webElement element in which text should be checked
* @param expectedValue expected text which should be present in the element
*/
public void waitValue(WebElement webElement, String expectedValue) {
waitValue(webElement, expectedValue, DEFAULT_TIMEOUT);
public void waitValueEqualsTo(WebElement webElement, String expectedValue) {
waitValueEqualsTo(webElement, expectedValue, DEFAULT_TIMEOUT);
}

/**
Expand All @@ -552,7 +552,7 @@ public void waitValue(WebElement webElement, String expectedValue) {
* @param expectedText text which should be presented
* @param timeout waiting time in seconds
*/
public void waitValuePresence(WebElement element, String expectedText, int timeout) {
public void waitValueContains(WebElement element, String expectedText, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -568,8 +568,8 @@ public void waitValuePresence(WebElement element, String expectedText, int timeo
* @param element element which should be checked
* @param expectedText text which should be presented
*/
public void waitValuePresence(WebElement element, String expectedText) {
waitValuePresence(element, expectedText, DEFAULT_TIMEOUT);
public void waitValueContains(WebElement element, String expectedText) {
waitValueContains(element, expectedText, DEFAULT_TIMEOUT);
}

/**
Expand All @@ -582,8 +582,8 @@ public void waitValuePresence(WebElement element, String expectedText) {
* @param expectedText text which should be present
* @param timeout waiting time in seconds
*/
public void waitValuePresence(By elementLocator, String expectedText, int timeout) {
waitValuePresence(waitVisibility(elementLocator, timeout), expectedText, timeout);
public void waitValueContains(By elementLocator, String expectedText, int timeout) {
waitValueContains(waitVisibility(elementLocator, timeout), expectedText, timeout);
}

/**
Expand All @@ -595,19 +595,19 @@ public void waitValuePresence(By elementLocator, String expectedText, int timeou
* @param elementLocator locator of the element which should be checked
* @param expectedText text which should be present
*/
public void waitValuePresence(By elementLocator, String expectedText) {
waitValuePresence(elementLocator, expectedText, DEFAULT_TIMEOUT);
public void waitValueContains(By elementLocator, String expectedText) {
waitValueContains(elementLocator, expectedText, DEFAULT_TIMEOUT);
}

/**
* Waits during {@code timeout} until text extracted from {@link WebElement} with specified {@code
* elementLocator} by {@link WebElement#getText()} is equivalent to provided {@code expectedText}.
* elementLocator} by {@link WebElement#getText()} equals to provided {@code expectedText}.
*
* @param elementLocator locator of element in which text should be checked
* @param expectedText expected text which should be present in the element
* @param timeout waiting time in seconds
*/
public void waitText(By elementLocator, String expectedText, int timeout) {
public void waitTextEqualsTo(By elementLocator, String expectedText, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -617,24 +617,24 @@ public void waitText(By elementLocator, String expectedText, int timeout) {

/**
* Waits until text extracted from {@link WebElement} with specified {@code elementLocator} by
* {@link WebElement#getText()} is equivalent to provided {@code expectedText}.
* {@link WebElement#getText()} equals to provided {@code expectedText}.
*
* @param elementLocator locator of element in which text should be checked
* @param expectedText expected text which should be present in the element
*/
public void waitText(By elementLocator, String expectedText) {
waitText(elementLocator, expectedText, DEFAULT_TIMEOUT);
public void waitTextEqualsTo(By elementLocator, String expectedText) {
waitTextEqualsTo(elementLocator, expectedText, DEFAULT_TIMEOUT);
}

/**
* Waits during {@code timeout} until text extracted from specified {@code webElement} by {@link
* WebElement#getText()} is equivalent to provided {@code expectedText}.
* WebElement#getText()} equals to provided {@code expectedText}.
*
* @param webElement element in which text should be checked
* @param expectedText expected text which should be present in the element
* @param timeout waiting time in seconds
*/
public void waitText(WebElement webElement, String expectedText, int timeout) {
public void waitTextEqualsTo(WebElement webElement, String expectedText, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -643,14 +643,14 @@ public void waitText(WebElement webElement, String expectedText, int timeout) {
}

/**
* Waits until text extracted from {@code webElement} by {@link WebElement#getText()} is
* equivalent to provided {@code expectedText}.
* Waits until text extracted from {@code webElement} by {@link WebElement#getText()} equals to
* provided {@code expectedText}.
*
* @param webElement element in which text should be checked
* @param expectedText expected text which should be present in the element
*/
public void waitText(WebElement webElement, String expectedText) {
waitText(webElement, expectedText, DEFAULT_TIMEOUT);
public void waitTextEqualsTo(WebElement webElement, String expectedText) {
waitTextEqualsTo(webElement, expectedText, DEFAULT_TIMEOUT);
}

/**
Expand All @@ -663,7 +663,7 @@ public void waitText(WebElement webElement, String expectedText) {
* @param expectedText text which should be presented
* @param timeout waiting time in seconds
*/
public void waitTextPresence(WebElement element, String expectedText, int timeout) {
public void waitTextContains(WebElement element, String expectedText, int timeout) {
webDriverWaitFactory
.get(timeout)
.until(
Expand All @@ -679,8 +679,8 @@ public void waitTextPresence(WebElement element, String expectedText, int timeou
* @param element element which should be checked
* @param expectedText text which should be presented
*/
public void waitTextPresence(WebElement element, String expectedText) {
waitTextPresence(element, expectedText, DEFAULT_TIMEOUT);
public void waitTextContains(WebElement element, String expectedText) {
waitTextContains(element, expectedText, DEFAULT_TIMEOUT);
}

/**
Expand All @@ -693,8 +693,8 @@ public void waitTextPresence(WebElement element, String expectedText) {
* @param expectedText text which should be presented
* @param timeout waiting time in seconds
*/
public void waitTextPresence(By elementLocator, String expectedText, int timeout) {
waitTextPresence(waitVisibility(elementLocator, timeout), expectedText, timeout);
public void waitTextContains(By elementLocator, String expectedText, int timeout) {
waitTextContains(waitVisibility(elementLocator, timeout), expectedText, timeout);
}

/**
Expand All @@ -706,8 +706,8 @@ public void waitTextPresence(By elementLocator, String expectedText, int timeout
* @param elementLocator locator of the element which should be checked
* @param expectedText text which should be presented
*/
public void waitTextPresence(By elementLocator, String expectedText) {
waitTextPresence(elementLocator, expectedText, DEFAULT_TIMEOUT);
public void waitTextContains(By elementLocator, String expectedText) {
waitTextContains(elementLocator, expectedText, DEFAULT_TIMEOUT);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public void waitFormToClose() {
* @param expectedText expected text in widget
*/
public void containsText(final String expectedText) {
seleniumWebDriverHelper.waitText(warning_Text, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
seleniumWebDriverHelper.waitTextContains(
warning_Text, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void waitExpectedMessageOnProgressPanelAndClosed(final String message) {
* @param timeout timeout defined by user
*/
public void waitExpectedMessageOnProgressPanelAndClosed(final String message, final int timeout) {
seleniumWebDriverHelper.waitTextPresence(progressPopupPanel, message, timeout);
seleniumWebDriverHelper.waitTextContains(progressPopupPanel, message, timeout);
waitProgressPopupPanelClose(timeout);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void clickOnPreviousDiffButton() {
* @param expText expected value
*/
public void waitExpectedTextIntoLeftEditor(String expText) {
seleniumWebDriverHelper.waitTextPresence(leftCompareEditor, expText);
seleniumWebDriverHelper.waitTextContains(leftCompareEditor, expText);
}

/**
Expand All @@ -157,7 +157,7 @@ public void waitTextNotPresentIntoLeftEditor(String expText) {
* @param expText expected value
*/
public void waitExpectedTextIntoRightEditor(String expText) {
seleniumWebDriverHelper.waitTextPresence(rightCompareEditor, expText);
seleniumWebDriverHelper.waitTextContains(rightCompareEditor, expText);
}

/**
Expand Down Expand Up @@ -297,7 +297,7 @@ public void waitGroupGitCompareIsClosed() {
* @param expText is expected value
*/
public void waitExpTextInGroupGitCompare(String expText) {
seleniumWebDriverHelper.waitTextPresence(By.id(Locators.GROUP_COMPARE_TEXT_AREA_ID), expText);
seleniumWebDriverHelper.waitTextContains(By.id(Locators.GROUP_COMPARE_TEXT_AREA_ID), expText);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void selectHistoryRowByIndex(int rowIndex) {

/** wait appear text in history list */
public void waitTextInHistoryList(final String expectedText) {
seleniumWebDriverHelper.waitTextPresence(
seleniumWebDriverHelper.waitTextContains(
historyForm, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
}

Expand All @@ -101,7 +101,7 @@ public void waitHistoryEditor() {
* @param expectedContent
*/
public void waitContentIntoHistoryEditor(final String expectedContent) {
seleniumWebDriverHelper.waitValuePresence(historyEditor, expectedContent);
seleniumWebDriverHelper.waitValueContains(historyEditor, expectedContent);
}

public void waitCommitInHistoryForm(String text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public void typeTextIntoNameCommandField(String commandName) {
* @param expectedText text which should be displayed
*/
public void waitTextIntoNameCommandField(String expectedText) {
seleniumWebDriverHelper.waitValue(
seleniumWebDriverHelper.waitValueEqualsTo(
nameCommandField, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
}

Expand All @@ -389,7 +389,8 @@ public void waitTextIntoNameCommandField(String expectedText) {
* @param expectedText text which should be displayed
*/
public void waitTextIntoGoalField(String expectedText) {
seleniumWebDriverHelper.waitText(nameGoalField, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
seleniumWebDriverHelper.waitTextEqualsTo(
nameGoalField, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
}

/**
Expand Down Expand Up @@ -469,7 +470,7 @@ public void typeTextIntoSearchMacroField(String text) {
* @param expectedText text which should be displayed
*/
public void waitTextIntoSearchMacroField(String expectedText) {
seleniumWebDriverHelper.waitValue(
seleniumWebDriverHelper.waitValueEqualsTo(
macrosInputField, expectedText, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
}

Expand Down