Giter VIP home page Giter VIP logo

page-factory-2's Introduction

Page Factory 2

Build Status GitHub release Maven Central

Page-Factory-2 это opensource java framework для автоматизированного тестирования, который позволяет разрабатывать автотесты в BDD (Behaviour Driven Development) стиле с акцентом на использование паттерна PageFactory.

О Page Factory 2

Инструмент позволяет писать автотесты на человекочитаемом языке, тем самым понижая входной порог для разработчиков тестов и повышая их читаемость неподготовленными пользователями. Page factory 2 использует framework Cucumber-JVM, но, в отличие от чистого использования, в котором довольно большую часть архитектуры занимают шаги(stepdefs), здесь акцент сделан на то, чтобы избавиться от необходимости писать их самому, или сократить количество самописных шагов(stepdefs) сосредоточившись на описании кода страниц с использованием паттерна Page Object. В Page Factory 2 уже реализовано много стандартных шагов(steps), которых хватит, чтобы начать разрабатывать автоматизированные тесты. Page Factory 2 кроссплатформенный фреймворк который позволяет запускать тесты на всех популярных браузерах. Также Page Factory 2 умеет работать с приложения на iOs и Android, использует для этого Appium. Для облегчения работы с feature файлами был разработан Idea-плагин, который поддерживает автодополнение шагов, страниц, элементов и возможность перехода к ним.

Требования

Для работы Page-Factory-2 нужно:

  1. Java 8 или выше

Документация

Начать пользоваться page-factory-2 очень просто, можно начать с подготовленных примеров или воспользоваться документацией

Контакты

Нашли ошибку или появились вопросы? Проверьте нет ли уже созданных issue, если нет, то создайте новый запрос!

Лицензия

Page-Factory-2 выпущен под лицензией Apache 2.0. Подробности.

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs 🔥

Travis-ci for cloud CI/CD resources 🚀

Jetbrains for the most awesome Java IDE ever ❤️

page-factory-2's People

Contributors

0i0u3uk avatar belka0107 avatar clicman avatar dependabot[bot] avatar hooligan4ik95 avatar imixac avatar kosteman avatar markeloff86 avatar megaman248 avatar oversquall avatar prosviryakovvadim avatar sandrabarmina avatar savkk avatar savlgmbh avatar skidheif avatar svetlanautina avatar utinasvetlana avatar varivoda avatar vserpokryl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

page-factory-2's Issues

Rest Endpoint called twice with send() always gets params from the first one.

Ho to reproduce:

ApiSteps.getInstance().fill(SomeEndpointEntry.class).add(HEADER, "Authorization", "1").send();
ApiSteps.getInstance().fill(SomeEndpointEntry.class).add(HEADER, "Authorization", "2").send();

Problems:

  1. Method send() always executes the first endpoint in the list.
  2. Endpoints aren't cleared between scenario outline examples.

В page-factory-2 перестал работать запуск локального chromedriver

Когда задаешь webdriver.drivers.path=src/test/resources/webdrivers/chromedriver.exe , то вылетает
btqa.tag.pagefactory.web.drivers.WebDriverService - Attempt 1 to start web driver
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

В первой page-factory webdriver.drivers.path работает.

Non-critical error trying to get screenshot even runs an api only

[INFO] tag.pagefactory.mobile.drivers.MobileDriverService - Capabilities are Capabilities {app: , appActivity: , appPackage: , appiumVersion: , autoGrantPermissions: true, browserName: , deviceName: , deviceOrientation: , platformName: , platformVersion: , resetKeyboard: true, unicodeKeyboard: true}
[ERROR] ru.sbtqa.tag.pagefactory.allure.ErrorHandler - Can't attach screenshot to allure reports
ru.sbtqa.tag.pagefactory.exceptions.FactoryRuntimeException: Could not parse appium url. Check 'appium.url' property
at ru.sbtqa.tag.pagefactory.mobile.drivers.MobileDriverService.mountDriver(MobileDriverService.java:53)
at ru.sbtqa.tag.pagefactory.mobile.drivers.MobileDriverService.getDriver(MobileDriverService.java:77)
at ru.sbtqa.tag.pagefactory.mobile.drivers.MobileDriverService.getDriver(MobileDriverService.java:1)
at ru.sbtqa.tag.pagefactory.utils.ScreenshotUtils$1.take(ScreenshotUtils.java:21)
at ru.sbtqa.tag.pagefactory.allure.ErrorHandler.attachScreenshot(ErrorHandler.java:20)
at ru.sbtqa.tag.pagefactory.aspects.CriticalStepCheckAspect.attachError(CriticalStepCheckAspect.java:84)
at ru.sbtqa.tag.pagefactory.aspects.CriticalStepCheckAspect.ajc$inlineAccessMethod$ru_sbtqa_tag_pagefactory_aspects_CriticalStepCheckAspect$ru_sbtqa_tag_pagefactory_aspects_CriticalStepCheckAspect$attachError(CriticalStepCheckAspect.java:1)
at ru.sbtqa.tag.pagefactory.aspects.CriticalStepCheckAspect.runStep(CriticalStepCheckAspect.java:70)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep_aroundBody2(TestStep.java:102)
at cucumber.api.TestStep$AjcClosure3.run(TestStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.executeStep(StashAspect.java:67)
at cucumber.api.TestStep.executeStep(TestStep.java:101)
at cucumber.api.TestStep.run_aroundBody0(TestStep.java:83)
at cucumber.api.TestStep$AjcClosure1.run(TestStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.run(StashAspect.java:52)
at cucumber.api.TestStep.run(TestStep.java:78)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.net.MalformedURLException: no protocol:
at java.net.URL.(URL.java:593)
at java.net.URL.(URL.java:490)
at java.net.URL.(URL.java:439)
at ru.sbtqa.tag.pagefactory.mobile.drivers.MobileDriverService.mountDriver(MobileDriverService.java:51)
... 45 more
* ? system returns "error" with parameters # ApiStepDefs.validate(String,DataTable)
| message | Access token is missing or invalid |
| http code | 401 |
| code | 38 |
ru.sbtqa.tag.api.exception.RestPluginException: Failed to execute validation rule "error" in "Login" endpoint entry
at ru.sbtqa.tag.api.utils.ReflectionUtils.invoke(ReflectionUtils.java:46)
at ru.sbtqa.tag.api.EndpointEntryReflection.validate(EndpointEntryReflection.java:144)
at ru.sbtqa.tag.api.EndpointEntry.validate(EndpointEntry.java:159)
at ru.sbtqa.tag.stepdefs.en.ApiStepDefs.validate(ApiStepDefs.java:50)
at ✽.system returns "error" with parameters(src/test/resources/features/login/Login.feature:16)
Caused by: java.lang.AssertionError: 1 expectation failed.
JSON path message doesn't match.
Expected: Access token is missing or invalid
Actual: Account with these credentials does not exist

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:483)
at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:655)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at io.restassured.internal.ResponseSpecificationImpl.content(ResponseSpecificationImpl.groovy:275)
at io.restassured.specification.ResponseSpecification$content$1.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at io.restassured.specification.ResponseSpecification$content$1.callCurrent(Unknown Source)
at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:258)
at io.restassured.internal.ValidatableResponseOptionsImpl.body(ValidatableResponseOptionsImpl.java:274)
at com.savl.qa.rest.LoginEndpointEntry.validateError(LoginEndpointEntry.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ru.sbtqa.tag.api.utils.ReflectionUtils.invoke(ReflectionUtils.java:36)
at ru.sbtqa.tag.api.EndpointEntryReflection.validate(EndpointEntryReflection.java:144)
at ru.sbtqa.tag.api.EndpointEntry.validate(EndpointEntry.java:159)
at ru.sbtqa.tag.stepdefs.en.ApiStepDefs.validate(ApiStepDefs.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:32)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:26)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep_aroundBody0(StepDefinitionMatch.java:40)
at cucumber.runtime.StepDefinitionMatch$AjcClosure1.run(StepDefinitionMatch.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.CriticalStepCheckAspect.runStep(CriticalStepCheckAspect.java:67)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep_aroundBody2(TestStep.java:102)
at cucumber.api.TestStep$AjcClosure3.run(TestStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.executeStep(StashAspect.java:67)
at cucumber.api.TestStep.executeStep(TestStep.java:101)
at cucumber.api.TestStep.run_aroundBody0(TestStep.java:83)
at cucumber.api.TestStep$AjcClosure1.run(TestStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.run(StashAspect.java:52)
at cucumber.api.TestStep.run(TestStep.java:78)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

WebEnvironment.getBrowserName always returning same IE name

page-factory2 2.0.0
InternetExplorerDriver server (32-bit)
3.12.0.0

I'm receiving an error:
org.openqa.selenium.SessionNotCreatedException: No matching capability sets found. Unable to match capability set 0: **browserName must be 'internet explorer', but was 'IE'** Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z' System info: host: 'CA-EC63000', ip: '10.76.8.2', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144' Driver info: driver.version: InternetExplorerDriver remote stacktrace: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:209) at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:223) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:215) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:160) at ru.sbtqa.tag.pagefactory.web.drivers.WebDriverService.createDriver(WebDriverService.java:92) at ru.sbtqa.tag.pagefactory.web.drivers.WebDriverService.mountDriver(WebDriverService.java:56) at ru.sbtqa.tag.stepdefs.CoreSetupSteps.setUp(CoreSetupSteps.java:36) at ru.sbtqa.tag.stepdefs.ru.CoreStepDefs.setUp(CoreStepDefs.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:31) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:25) at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60) at cucumber.runtime.HookDefinitionMatch.runStep(HookDefinitionMatch.java:17) at cucumber.runner.UnskipableStep.executeStep(UnskipableStep.java:22) at cucumber.api.TestStep.run(TestStep.java:83) at cucumber.api.TestCase.run(TestCase.java:58) at cucumber.runner.Runner.runPickle(Runner.java:80) at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

In application.properties I have:
webdriver.browser.name = INTERNET_EXPLORER
And I expect to get:
`public enum BrowserName {

IE("ie"),
**INTERNET_EXPLORER("internet explorer"),**
IEXPLORE("iexplore"),
CHROME("chrome"),
FIREFOX("firefox"),
OPERA("firefox"),
SAFARI("safari");

private String name;

BrowserName(String name) {
    this.name = name;
}

}
`
But I recieve "ie" because of:

`public class WebEnvironment extends Environment {

private static final WebConfiguration PROPERTIES = ConfigFactory.create(WebConfiguration.class);

public static BrowserName getBrowserName() {
    return adaptBrowserName(PROPERTIES.getBrowserName());
}

private static BrowserName adaptBrowserName(String name) {
    BrowserName browserName = BrowserName.valueOf(name.toUpperCase());
    return isIE(browserName) **? BrowserName.IE** : browserName;
}

private static boolean isIE(BrowserName browserName) {
    return browserName.equals(BrowserName.IE)
            **|| browserName.equals(BrowserName.INTERNET_EXPLORER)**
            || browserName.equals(BrowserName.IEXPLORE);
}

`

Найти аналог метода waitForElementGetEnabled

Подскажите в pf1 в классе DriverExtension был метод
public static void waitForElementGetEnabled(WebElement webElement, long timeout) throws WaitException {

Где найти его аналог в pf2.

Плюс подскажите актуальную ссылку, а то на эту выдает 404

  1. По части миграции ui: большинство случаев описано здесь https://github.com/sbtqa/docs/wiki/PF-to-PF2-migration

How to parameterized query in form data.

Hi!
I have a query as Form Data, for example:

param_1: [{"value"=value-1}, {"value"=value-2}]
param_2: some value

How to pass parameters value-1 and value-2 from feature? Like a

  • user sends request for "form data" with parameters
    | query-parameter-name-1 | query-parameter-value-1 |
    | header-parameter-name-1 | header-parameter-value-1 |

We need to supply override of endpoint entries params in constructor

Example:

@Endpoint(method = Rest.POST, path = "/login", title = "Login", template = "templates/login.json")
public class LoginEndpointEntry extends BaseEndpoint {

    @Body(name = "hash")
    private String hash;

    public LoginEndpointEntry() {
        super();
        this.hash = Utils.hash(hash);
    }
}

Driver service can't find the IE executable when we setting the webdriver.drivers.path property

I'm trying to migrate from page-factory 1.11.0 to page-factory2 2.0.0.

I'm getting:
[INFO] sbtqa.tag.pagefactory.web.drivers.WebDriverService - Attempt 1 to start web driver java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:847) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124) at org.openqa.selenium.ie.InternetExplorerDriverService.access$000(InternetExplorerDriverService.java:32) at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339) at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:291) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:213) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:160) at ru.sbtqa.tag.pagefactory.web.drivers.WebDriverService.createDriver(WebDriverService.java:92) at ru.sbtqa.tag.pagefactory.web.drivers.WebDriverService.mountDriver(WebDriverService.java:56) at ru.sbtqa.tag.stepdefs.CoreSetupSteps.setUp(CoreSetupSteps.java:36) at ru.sbtqa.tag.stepdefs.ru.CoreStepDefs.setUp(CoreStepDefs.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:31) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:25) at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60) at cucumber.runtime.HookDefinitionMatch.runStep(HookDefinitionMatch.java:17) at cucumber.runner.UnskipableStep.executeStep(UnskipableStep.java:22) at cucumber.api.TestStep.run(TestStep.java:83) at cucumber.api.TestCase.run(TestCase.java:58) at cucumber.runner.Runner.runPickle(Runner.java:80) at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

My application.properties:
`
#COMMON BLOCK
#mobile or web
driver.environment = web

#path to page objects
page.package = ru.sbtqa.xxxx.yyyy.zzzz

#default wait timeout in milliseconds
page.load.timeout = 60000

#optional. Using aspect in tests. False by default.
page.aspect.disabled = false

#optional. false by default
video.enabled = false
video.path.dest = /tmp/video
video.path.temp = /tmp/video
video.highlight.enabled = false

#optional. driver or raw. Raw by default
screenshot.strategy = raw

#optional. tasks to kill before test (ONLY FOR WINDOWS)
tasks.to.kill = iexplorer

#IN CASE OF WEB
#parameters for web driver create
webdriver.browser.name = IE
webdriver.starting.url = http://xxxxxxx.vm.mos.cloud.sbrf.ru/ui/

#optional. The number of start attempts webdriver. 3 by default
webdriver.create.attempts = 3

#optional. If path is not specified webdrivers will be searched in system PATH
webdriver.drivers.path = src/test/resources/webdrivers/
`
Exception is thrown from selenium-remote-driver/3.11.0/selenium-remote-driver-3.11.0-sources.jar!/org/openqa/selenium/remote/service/DriverService.java:117
In method findExecutable

It is looking for a IE executable(IEDriverServer with several executable extensions) in PATH and trying to find path by System,getProperty "webdriver.ie.driver" which is empty.

i18n for strategies

  • пользователь свайпает по стратегии совпадения "EXACT" до текста "текст"
    и этот шаг мапится на SwipeUtils.swipeToText(MatchStrategy.valueOf(strategy), text);
    И вот в русской фиче EXACT выглядит не супер

NPE on mobile plugin in deps and no page.package set in config

cucumber.runtime.CucumberException: Failed to instantiate class ru.sbtqa.tag.stepdefs.en.MobileStepDefs
at cucumber.runtime.java.DefaultJavaObjectFactory.cacheNewInstance(DefaultJavaObjectFactory.java:47)
at cucumber.runtime.java.DefaultJavaObjectFactory.getInstance(DefaultJavaObjectFactory.java:33)
at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
at cucumber.runtime.HookDefinitionMatch.runStep(HookDefinitionMatch.java:17)
at cucumber.runner.UnskipableStep.executeStep_aroundBody0(UnskipableStep.java:22)
at cucumber.runner.UnskipableStep$AjcClosure1.run(UnskipableStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.executeStep(StashAspect.java:67)
at cucumber.runner.UnskipableStep.executeStep(UnskipableStep.java:22)
at cucumber.api.TestStep.run_aroundBody0(TestStep.java:83)
at cucumber.api.TestStep$AjcClosure1.run(TestStep.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at ru.sbtqa.tag.pagefactory.aspects.StashAspect.run(StashAspect.java:52)
at cucumber.api.TestStep.run(TestStep.java:78)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at cucumber.runtime.java.DefaultJavaObjectFactory.cacheNewInstance(DefaultJavaObjectFactory.java:41)
... 40 more
Caused by: java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:882)
at com.google.common.reflect.ClassPath.getTopLevelClassesRecursive(ClassPath.java:162)
at ru.sbtqa.tag.pagefactory.PageManager.getAllClasses(PageManager.java:153)
at ru.sbtqa.tag.pagefactory.PageManager.cachePages(PageManager.java:132)
at ru.sbtqa.tag.pagefactory.mobile.junit.MobileSetupSteps.initMobile(MobileSetupSteps.java:16)
at ru.sbtqa.tag.pagefactory.mobile.junit.MobileStepsImpl.<init>(MobileStepsImpl.java:12)
at ru.sbtqa.tag.pagefactory.mobile.junit.MobileSteps.<init>(MobileSteps.java:5)
at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(ThreadLocal.java:284)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180)
at java.lang.ThreadLocal.get(ThreadLocal.java:170)
at ru.sbtqa.tag.pagefactory.mobile.junit.MobileSteps.getInstance(MobileSteps.java:10)
at ru.sbtqa.tag.stepdefs.en.MobileStepDefs.<init>(MobileStepDefs.java:11)
... 45 more

добавить setLocalFileDetector при инициализации RemoteWebDriver

для того, чтобы заливка файлов работала на селениум хабе (моон, селеноид и т.п.) необходимо настроить FileDetector

класс - WebDriverService
метод createRemoteWebDriver

добавить строчку
remoteWebDriver.setFileDetector(new LocalFileDetector());

в создание не ремоут драйвера не нужно добавлять этот код

ConfigFactory.create - add system properties

As a user I want to configure execution by Jenkins job (e.g. I want to change browser type for hub execution)

I have browser.type=internet explorer in test.properties
I want to specify parameter browser.type=chrome in Jenkins job , which is available during execution from System.properties

So my assumption is to do something like that:

SystemEnvProperties cfg = ConfigFactory
    .create(SystemEnvProperties.class, 
            System.getProperties(), 
            System.getenv());

as per: http://owner.aeonbits.org/docs/importing-properties/
If there are prop1 and prop2 defining two different values for the same property key, the one specified first will prevail:

Properties p1 = new Properties();
p1.setProperty("foo", "pineapple");
p1.setProperty("bar", "lime");

Properties p2 = new Properties();
p2.setProperty("bar", "grapefruit");
p2.setProperty("baz", "blackberry");


ImportConfig cfg = ConfigFactory
    .create(ImportConfig.class, p1, p2); // props imported!

assertEquals("pineapple", cfg.foo());

// p1 prevails, so this is lime and not grapefruit
assertEquals("lime", cfg.bar()); 

assertEquals("blackberry", cfg.baz());

add support MicrosoftEdge to web plugin

     } else {
            if (browserName.equals(BrowserName.FIREFOX)) {
                setWebDriver(new FirefoxDriver(capabilities));
            } else if (browserName.equals(BrowserName.SAFARI)) {
                setWebDriver(new SafariDriver(capabilities));
            } else if (browserName.equals(BrowserName.CHROME)) {
                WebDriverManagerConfigurator.configureDriver(ChromeDriverManager.getInstance(), BrowserName.CHROME.getName());
                setWebDriver(new ChromeDriver(capabilities));
            } else if (browserName.equals(BrowserName.INTERNET_EXPLORER)) {
                WebDriverManagerConfigurator.configureDriver(InternetExplorerDriverManager.getInstance(), BrowserName.IE.getName());
                setWebDriver(new InternetExplorerDriver(capabilities));
            } else {
                throw new UnsupportedBrowserException("'" + browserName + "' is not supported yet");
}

To this place!

Configure default capability to Java7

As we still support core capability to java 7, source targets should point to 1.7 platform.
But as soon we use plugins functionality it should be possible to attach java8-only plugins (JDI for example)

Проблемы с запуском Android тестов

Добрый день.
Пример сценария лежит внутри page-factory-2 (mobile-plugin pagefactory.mobile CucumberTest)

При попытке запуска примера вылетает ошибка:
cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in ru.sbtqa.tag.stepdefs.ru.CoreStepDefs.fill(String,String) in .../page_factory-2/page-factory-core/target/classes/ and ru.sbtqa.tag.stepdefs.ru.CoreStepDefs.fill(String,String) in .../page_factory-2/page-factory-core/target/classes/

Возможно ли вынести пример с мобильными тестами в page-factory-2-example b lj,fdbnm в пример использование блоков и фрагментов?

Планируется ли делать поддержку IOS?

dependencies structure

Now every plugin has core in his dependencies. I suggest to split plugins and core part (and mb merge core with api) and then load core part dynamically from end-point project like we did with datajack (#89). In this case we will simplify dependencies and in end-point project all we need to do is to add core dependency and elements plugin.

Проблема при использовании Connector и data.type=properties

qa-ulits. Версия 1.4.0
pf2. Версия 10.1.3

В конструкторе класса Connector стоит Props.get(name+".url"), который по дефолту тянет из application.properties. Если использовать data.type=properties, то параметры подключения к БД лежат в другом properties-файле (для разных конфигураций) и Connector не работает.

Я так понимаю актуально для использование любого data.type

Decide how to reflect to nullable value

We need to supply a "", null and removed values.
For example, we have the following body template:

{
  "message": "${message}"
}

Now if pass the empty value to a data table, the template will generate as is.
But we should support an empty string value, null and remove it from the template at all:

{"message": ""}

{"message": null}

{}

So we need to think about how to do it.

My suggestion is:

  1. pass ""
  2. null
  3. an empty input

NPE in webplugin 11.0.0

Воспроизведен NPE. Ошибка возникает, если в проекте присутствует пустая cucumber feature (на pf1 при инициализации такой ошибки не было), удаление фичи помогло, но мне кажется стоит добавить обработку null

java.lang.NullPointerException
at ru.sbtqa.tag.pagefactory.data.DataUtils.formFeatureData(DataUtils.java:54)
at ru.sbtqa.tag.pagefactory.data.DataParser.replace(DataParser.java:25)
at ru.sbtqa.tag.pagefactory.aspects.CucumberAspect.replaceSteps(CucumberAspect.java:32)
at cucumber.api.junit.Cucumber.(Cucumber.java:83)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

rework modules structure

Now we have very strange modules structure: f.e. api module in core dir etc.
Need to rework this with more structured levels of abstraction

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.