Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #77 from sbtqa/goms
Browse files Browse the repository at this point in the history
Add step def
  • Loading branch information
kosteman authored Oct 3, 2017
2 parents 6e6c201 + 5ef11a3 commit c717da5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.sbtqa.tag.pagefactory.Page;
import ru.sbtqa.tag.pagefactory.PageFactory;
import ru.sbtqa.tag.pagefactory.exceptions.PageException;
import ru.sbtqa.tag.pagefactory.exceptions.PageInitializationException;
Expand Down Expand Up @@ -51,6 +54,8 @@
*/
public class GenericStepDefs {

private static final Logger LOG = LoggerFactory.getLogger(GenericStepDefs.class);

/**
* Execute action with no parameters inside block element User|he keywords
* are optional
Expand Down Expand Up @@ -421,4 +426,15 @@ public void reInitPage() {
public void swipeToText(String direction, String text) throws SwipeException {
MobileExtension.swipeToText(DirectionStrategy.valueOf(direction.toUpperCase()), text);
}

/**
* Element is focused
*
* @param element
* @throws SwipeException if the text is not found or swipe depth is reached
*/
@And("ru.sbtqa.tag.pagefactory.isElementFocused")
public void isElementFocused(String element) throws SwipeException {
LOG.warn("Note that isElementFocused method is still an empty!");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ ru.sbtqa.tag.pagefactory.backPage=^user push back in the browser$
ru.sbtqa.tag.pagefactory.goToPageByUrl=^user navigates to page \"(.*?)\"$
ru.sbtqa.tag.pagefactory.goToUrl=^user navigates to url \"(.*?)\"$
ru.sbtqa.tag.pagefactory.reInitPage=^user refreshes the page$
ru.sbtqa.tag.pagefactory.swipeToText=^user swipes "(.*?)" to text "(.*?)"$
ru.sbtqa.tag.pagefactory.swipeToText=^user swipes "(.*?)" to text "(.*?)"$
ru.sbtqa.tag.pagefactory.isElementFocused=^element \"([^\"]*)\" is focused$
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ ru.sbtqa.tag.pagefactory.backPage=^(?:пользователь |он |)нажи
ru.sbtqa.tag.pagefactory.goToPageByUrl=^(?:пользователь |он |)переходит на страницу \"(.*?)\" по ссылке$
ru.sbtqa.tag.pagefactory.goToUrl=^(?:пользователь |он |)(?:переходит на|открывает) url "(.*?)"$
ru.sbtqa.tag.pagefactory.reInitPage=^обновляем страницу$
ru.sbtqa.tag.pagefactory.swipeToText=^пользователь свайпает экран \"([^\"]*)\" до текста \"([^\"]*)\"$
ru.sbtqa.tag.pagefactory.swipeToText=^пользователь свайпает экран \"([^\"]*)\" до текста \"([^\"]*)\"$
ru.sbtqa.tag.pagefactory.isElementFocused=^в фокусе находится элемент \"([^\"]*)\"$

0 comments on commit c717da5

Please sign in to comment.