Giter Site home page Giter Site logo

page-factory's People

Contributors

0i0u3uk avatar clicman avatar cyberspaceru avatar iamanikeev avatar imixac avatar kosteman avatar lamkovod avatar leonidkulik avatar markeloff86 avatar ostryak avatar pavelalennikov avatar sandrabarmina avatar scorpds avatar varivoda 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

Watchers

 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

page-factory's Issues

webdriver shared

Need to impement webdriver.shared option.
This option allow webdriver to stay alive between tests in single run.

TagWebDriver.getDriver() fails without page.load.timeout property with bad error message.

Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.parseInt(Integer.java:615)
at ru.sbtqa.tag.pagefactory.PageFactory.getTimeOutInSeconds(PageFactory.java:121)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:181)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:77)
at Main.main(Main.java:6)

Multithreading (multiple instances of the webdriver)

On projects with multiple tests (more than 1000), according to DevOps, it will not be possible to quickly run these tests (previously used for the run of regression tests almost all night). For this reason, I would like to create several instances of a webdriver, and not just one. Was it in the plans (pf-2?)?

Fix Logging

Now not displayed the test' steps in output
before pagefactory, errror in the test's result was displayed on the first place. Now it is lost in unnecessary log
Sorry for my English =)

Reduce boilerplate stacktraces from exceptions

Now We have a lot of unnecessary information in some exceptions:

ru.sbtqa.tag.pagefactory.exceptions.FactoryRuntimeException: Failed to invoke method
        at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:855)
        at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
        at ✽.И pagefactory° пользователь (проверяет присутствие продукта) "KARCHER WD 3 Premium1"(YandexMarket.feature:9)
Caused by: java.lang.reflect.InvocationTargetException: null
        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.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
        at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
        at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
        at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
        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:40)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:34)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
        at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
        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:70)
        at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
        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.api.junit.Cucumber.run(Cucumber.java:100)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.AssertionError: Продукт KARCHER WD 3 Premium1 не был найден
        at org.junit.Assert.fail(Assert.java:88)
        at ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:30)
        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.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
        at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
        at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
        at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
        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:40)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:34)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
        at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
        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:70)
        at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
        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.api.junit.Cucumber.run(Cucumber.java:100)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

So we should pull up main caused by and strip all that in before and produce this instead:

java.lang.AssertionError: Продукт KARCHER WD 3 Premium1 не был найден
        at org.junit.Assert.fail(Assert.java:88)
        at ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:30)
        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.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
        at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
        at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
        at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
        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:40)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:34)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
        at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
        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:70)
        at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
        at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
        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.api.junit.Cucumber.run(Cucumber.java:100)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Strange regexp for step openPage

ru.sbtqa.tag.pagefactory.openPage=^(?:пользователь |он |)(?:находится на странице|открывается страница|открывается вкладка мастера) "([^\"]*)"$

This regexp matches to strange step like this: пользователь|он открывается страница ...

ChromeDriver crashes

Class: TagWebDriver
Line 134: webDriver.manage().window().maximize();

Кучу дефектов в интернете что так он будет падать, если еще не было перехода по URL.
(и он таки падает)

Рекомендуемый способ максимайза для хром:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
driver = new ChromeDriver(chromeOptions);

Fix spelling error in i18n

In russian localization we have spelling errors:

ru.sbtqa.tag.pagefactory.userActionTwoParams=^(?:пользователь |он |)\\((.*?)\\) (?:с параметрарми |)\"([^\"]*)\" \"([^\"]*)\"$
ru.sbtqa.tag.pagefactory.userActionThreeParams=^(?:пользователь |он |)\\((.*?)\\) (?:с параметрарми |)\"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\"$

Should be "параметрами" but now "параметрарми"

Add property for working with aspects

Now we can disable aspects only through the method setAspectsDisabled(). I think we should add new property to application.properties for work with it.

The webdriver for IE does not starting on version 1.5.0+

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:197)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
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:296)
at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:150)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:143)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:106)
at ru.sbtqa.tag.pagefactory.PageFactory.getDriver(PageFactory.java:49)
at ru.sbtqa.tag.pagefactory.PageFactory.getWebDriver(PageFactory.java:39)
at ru.sbt.qa.selenium.react.stepdefs.impl.CommonStepsImpl.(CommonStepsImpl.java:24)
at ru.sbt.qa.selenium.react.stepdefs.base.StepDefsBase.getCommonSteps(StepDefsBase.java:20)
at ru.sbt.qa.sanctions.ui.stepdefs.AuthorizationStepDefs.authorizedInSystem(AuthorizationStepDefs.java:16)
at ?.* пользователь авторизован в системе(1812.feature:5)

Scenario outline is broken

It seems that this is due to private static WebDriver webDriver;

ru.sbtqa.tag.pagefactory.exceptions.FactoryRuntimeException: Failed to invoke method at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:860) at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionTwoParams(GenericStepDefs.java:260) at ✽.* user (fill the field) "email" "[email protected]"(landing.feature:9) Caused by: java.lang.reflect.InvocationTargetException 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.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97) at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:857) at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionTwoParams(GenericStepDefs.java:260) 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:40) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:34) at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38) at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37) at cucumber.runtime.Runtime.runStep(Runtime.java:300) at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44) at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) 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.ExamplesRunner.run(ExamplesRunner.java:59) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) 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.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) 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:70) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95) at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:106) at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:38) 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.api.junit.Cucumber.run(Cucumber.java:100) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' System info: host: 'sbt-ovb-ll001', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-53-generic', java.version: '1.8.0_121' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:134) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363) at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:413) at org.openqa.selenium.By$ById.findElement(By.java:218) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355) at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:69) at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38) at com.sun.proxy.$Proxy16.click(Unknown Source) at ru.sbtqa.tag.pagefactory.Page.click_aroundBody0(Page.java:76) at ru.sbtqa.tag.pagefactory.Page$AjcClosure1.run(Page.java:1) at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) at ru.sbtqa.tag.pagefactory.aspects.ClickAspect.doAroundClick(ClickAspect.java:76) at ru.sbtqa.tag.pagefactory.Page.fillField(Page.java:76) ... 66 more

We need to avoid driver file name in code. Need to move it to porps

   if (!WEBDRIVER_PATH.isEmpty()) {
File chromeDriver = new File(WEBDRIVER_PATH + "chromedriver.exe");
                        System.setProperty("webdriver.chrome.driver", chromeDriver.getAbsolutePath());
                    } else {
                        LOG.warn("The value of property 'webdriver.drivers.path is not specified."
                                + " Try to get {} driver from system PATH'", WEBDRIVER_BROWSER_NAME);
                    }

Deprecate getElementTitle()

It should be deprecated because it is being used in a very ugly manner. F.e. clickLink():

webElement = PageFactory.getInstance().getCurrentPage().getElementByTitle(elementTitle);
webElement.click();
Core.addToReport(webElement, " is clicked");

and then in addToReport():
String elementTitle = PageFactory.getInstance().getCurrentPage().getElementTitle(webElement);

FileSystemNotFoundException

Caused by: java.nio.file.FileSystemNotFoundException
at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
at java.nio.file.Paths.get(Paths.java:143)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getResourceJsonFileAsJsonObject(TagWebDriver.java:260)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.parseDriverVersionFromMapping(TagWebDriver.java:246)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureWebDriverManagerVersion(TagWebDriver.java:22)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureWebDriverManagerParams(TagWebDriver.java:19)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureDriver(TagWebDriver.java:177)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:140)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:110)
at ru.sbtqa.tag.pagefactory.PageFactory.getDriver(PageFactory.java:49)
at ru.sbt.ufsui.webdriver.page.AuthorizationPage.(AuthorizationPage.java:51)
... 46 more

page-factory:1.7.1

Implement several step definition classes

Need to put several classes with common step definitions:

  • searchers (elements, clocks, lists)
  • property checkers (find element, find out what type it is, check its properties, like visibility or availability)
  • interactions (find element of particular type, perform action specific to only that type)
  • table actions

Maybe this should even be a separate package, not sure

Add ability to invoke the fisrt webDriver.get method by yourself

This ability allows you control the moment when initial web page will be opened.
In this way we can easily construct tests which consist of several parts (swing, web, rest).

Ex:

  • user open swing application
    ... // swing steps
  • user open initial web page
    ... //web steps

Also we will be able to move the http-auth logic from createWebDriver to new step.

  • user open initial web page with http-auth

Bad regexp in openPage step

When I create a step "@Когда("^открывается страница "(.?)" и ожидает элемент "(.?)"$")" in my stepdefinitions and used in feature:

ru.sbtqa.tag.qautils.errors.AutotestError: Page object with title 'Стартовый менеджер" и ожидает элемент "Поиск по каталогу' is not registered
                at ru.sbtqa.tag.pagefactory.PageWrapper.getPage(PageWrapper.java:54)
                at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.openPage(GenericStepDefs.java:218)

VideoRecorder error in tearDown hook

VideoRecorder constructor assumes that video.path.dest property is mandatory.
So if it is not defined then error occured in page-factory SetupStepDefs.tearDown() method while trying to getInstance()

field.getType().equals(type) issue (HtmlElements)

I recently faced the problem when I couldn't use method findElementByTitleInBlock(blockName, elementTitle) because inside it uses findElementInBlock() which checks all fields in given block and then checks fields type, BUT it compares them using field.getType().equals(type). By default 'type' considered to be WebElement so it leads us to the problem when block's fields declared as TypifiedElement because of strict comparsion of classes.
I guess we may use isAssignableFrom() method instead of equals() which allows fields to be subclasses of 'type'

Unwrap the cause of exception wrapped by Reflection

Hello!

I just started to work with page-factory.
When I run page-factory-example I get an error:

FactoryRuntimeException:
Error while executing action 'проверяет присутствие продукта' on YmSearchResultsPage . See the caused exception below

This caused by:
ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:46)
Assert.fail("Продукт " + productName + " не был найден");

From:
ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:856)
at
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {

The reason is that the reflection layer wraps any exception in an InvocationTargetException(following the case we originally got just new AssertionError(message) from Assert).

As I said I'm just day 0 with a project and maybe misunderstood something. But I think it will be a good idea just to unwrap the exception in ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle and check the original one and pass it to Allure in case of Assertion.

Implement support Allure2

Allure 2 is very usefull framework and we need to use it in our project.
Please, implement support of this fremework to Page-factory.
Thank you.

Exception when I use userActionInBlockOneParam step

I always have exception in this method:
public void executeMethodByTitleInBlock(String blockPath, String actionTitle, Object... parameters)

I think its because in this method using break but should be return

unnecessary use ExceptionUtils.getRootCause

Данное сокращение листинга ошибки применяется только в одном методе executeMethodByTitle во всем фреймворке, может есть смысл убрать его?

Uncorrect return value of TagWebdriver.getBrowserName()

Class DesiredCapabilitiesParsaer can't parse my properties because I have a property line equals "webdriver.ie.capability.nativeEvents" but TagWebdriver.getBrowserName() always return a full name of Internet Explorer "internet explorer".

And then I getting "webdriver.internet explorer.capability.someCapability" it fail my parse process.

In HtmlBlock use ElementTitle annotation

Now if we want to use element in block, this element should have @name annotation, but by default in PageFactory framework we are using @ElementTitle. We need to support this annotation in framework

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.