-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e937f92
commit 76f5826
Showing
2 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 43 additions & 43 deletions
86
src/main/java/ru/colibri/ui/steps/general/SwipeSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
package ru.colibri.ui.steps.general; | ||
|
||
import io.appium.java_client.MobileElement; | ||
import io.appium.java_client.SwipeElementDirection; | ||
import org.jbehave.core.annotations.Named; | ||
import org.jbehave.core.annotations.When; | ||
import org.openqa.selenium.WebElement; | ||
import org.springframework.stereotype.Component; | ||
import ru.colibri.ui.core.steps.AbsSteps; | ||
import ru.yandex.qatools.allure.annotations.Step; | ||
|
||
@Component | ||
public class SwipeSteps extends AbsSteps { | ||
private static final int SWIPE_DURATION = 2000; | ||
|
||
@Step | ||
@When("вертикальный свайп \"$elementName\" вниз") | ||
public void swipingDown(@Named("$elementName") String elementName) { | ||
WebElement webElement = getWebElementByName(elementName); | ||
((MobileElement) webElement).swipe(SwipeElementDirection.DOWN, 1, 1, SWIPE_DURATION); | ||
} | ||
|
||
@Step | ||
@When("вертикальный свайп \"$elementName\" вверх") | ||
public void swipingUp(@Named("$elementName") String elementName) { | ||
WebElement webElement = getWebElementByName(elementName); | ||
((MobileElement) webElement).swipe(SwipeElementDirection.UP, 1, 1, SWIPE_DURATION); | ||
} | ||
|
||
@Step | ||
@When("горизонтальный свайп \"$elementName\" вправо") | ||
public void swipingRight(@Named("$elementName") String elementName) { | ||
WebElement webElement = getWebElementByName(elementName); | ||
((MobileElement) webElement).swipe(SwipeElementDirection.RIGHT, 1, 1, SWIPE_DURATION); | ||
} | ||
|
||
@Step | ||
@When("горизонтальный свайп \"$elementName\" влево") | ||
public void swipingLeft(@Named("$elementName") String elementName) { | ||
WebElement webElement = getWebElementByName(elementName); | ||
((MobileElement) webElement).swipe(SwipeElementDirection.LEFT, 1, 1, SWIPE_DURATION); | ||
} | ||
} | ||
//package ru.colibri.ui.steps.general; | ||
// | ||
//import io.appium.java_client.MobileElement; | ||
//import io.appium.java_client.SwipeElementDirection; | ||
//import org.jbehave.core.annotations.Named; | ||
//import org.jbehave.core.annotations.When; | ||
//import org.openqa.selenium.WebElement; | ||
//import org.springframework.stereotype.Component; | ||
//import ru.colibri.ui.core.steps.AbsSteps; | ||
//import ru.yandex.qatools.allure.annotations.Step; | ||
// | ||
//@Component | ||
//public class SwipeSteps extends AbsSteps { | ||
// private static final int SWIPE_DURATION = 2000; | ||
// | ||
// @Step | ||
// @When("вертикальный свайп \"$elementName\" вниз") | ||
// public void swipingDown(@Named("$elementName") String elementName) { | ||
// WebElement webElement = getWebElementByName(elementName); | ||
// ((MobileElement) webElement).swipe(SwipeElementDirection.DOWN, 1, 1, SWIPE_DURATION); | ||
// } | ||
// | ||
// @Step | ||
// @When("вертикальный свайп \"$elementName\" вверх") | ||
// public void swipingUp(@Named("$elementName") String elementName) { | ||
// WebElement webElement = getWebElementByName(elementName); | ||
// ((MobileElement) webElement).swipe(SwipeElementDirection.UP, 1, 1, SWIPE_DURATION); | ||
// } | ||
// | ||
// @Step | ||
// @When("горизонтальный свайп \"$elementName\" вправо") | ||
// public void swipingRight(@Named("$elementName") String elementName) { | ||
// WebElement webElement = getWebElementByName(elementName); | ||
// ((MobileElement) webElement).swipe(SwipeElementDirection.RIGHT, 1, 1, SWIPE_DURATION); | ||
// } | ||
// | ||
// @Step | ||
// @When("горизонтальный свайп \"$elementName\" влево") | ||
// public void swipingLeft(@Named("$elementName") String elementName) { | ||
// WebElement webElement = getWebElementByName(elementName); | ||
// ((MobileElement) webElement).swipe(SwipeElementDirection.LEFT, 1, 1, SWIPE_DURATION); | ||
// } | ||
//} |