Giter VIP home page Giter VIP logo

frameworkium-core's Introduction

Frameworkium Examples

build

This is a sample project which utilises frameworkium-core, a framework for writing maintainable Selenium and REST API tests that also makes integrating with other test things (e.g. JIRA) much easier.

Please see the Frameworkium usage guide for more details.

As a result:

<dependencies>
  <dependency>
    <groupId>com.github.frameworkium</groupId>
    <artifactId>frameworkium-core</artifactId>
    <!-- Update this with the latest from the frameworkium-core releases page -->
    <version>3.0.0</version>
  </dependency>
</dependencies>

The Frameworkium project is based on Ardesco's Selenium-Maven-Template and Joe VDW's Bootstrapium. We have extended it with some handy extras for getting started quickly with Selenium, Appium and Rest Assured.

Getting Started

After setting up apache maven, open the frameworkium-examples directory in a terminal/command prompt and run mvn clean verify to run the example tests using Firefox.

You will need the geckodriver on your path if you are using Firefox version 48 or above.

Browsers

You can provide the -Dbrowser argument to chose a browser to run the tests in.

Drivers

Each browser requires a "driver".

For chrome, ChromeDriver needs to be on your path or specified as an argument:

mvn clean verify -Dbrowser=chrome -Dwebdriver.chrome.driver=c:\path\to\chromedriver.exe

For Firefox 48 and above, geckodriver needs to be on your path or specified as an argument:

mvn clean verify -Dbrowser=firefox -Dwebdriver.gecko.driver=c:\path\to\geckodriver.exe

Selenium Grid

Want to run tests using a grid and in parallel?

mvn clean verify -Dbrowser=chrome -DgridURL=http://localhost:4444/wd/hub -Dthreads=4

All you need to do is ensure the browser is installed in the default location and that the driver is on the path.

Sauce Labs

Running mobile web tests using Appium on Sauce Labs is only slightly more involved:

export SAUCE_USERNAME=username
export SAUCE_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -Dsauce=true 

BrowserStack

Running mobile web tests using Appium on BrowserStack:

export BROWSER_STACK_USERNAME=username
export BROWSER_STACK_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -DbrowserStack=true 

A full list of arguments can be found on the guidance page.

Reporting

After running your tests, you can generate an Allure test report by simply running:

mvn allure:report 

Further Information

Frameworkium sets you up for other stuff too - check out the guidance page for further info.

frameworkium-core's People

Contributors

alex-ogedengbe avatar ardesco avatar dependabot[bot] avatar emerson-b avatar gitnikos avatar ham1 avatar hyphen31 avatar jleeh avatar jvanderwee avatar madmaximillion avatar mjl33 avatar noronhaa avatar robertgates55 avatar squiccups 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  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  avatar  avatar  avatar  avatar  avatar

frameworkium-core's Issues

Unable to open chrome browser

Describe the Issue
After we update fremeworkium 4 X version, we unable launching the chrome browser

To Reproduce
Steps to reproduce the behavior:

  1. we set custom chrome caps with extend ChromeImpl class
  2. add vm argument
  3. java.lang.NoClassDefFoundError: org/openqa/selenium/internal/Require

Expected Behaviour
launching the browser and navigate application URL

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Frameworkium-core version: [4.1.0.2]
  • OS: [ Windows 10]
  • Browser [Chrome]
  • Version [96.0.4664.110 (Official Build) (64-bit)]

Additional Context
Please provide any solution for this issue
Error trace

22:36:09.943 [main] ERROR - null
java.lang.NullPointerException: null
at com.frameworkium.core.ui.driver.lifecycle.SingleUseDriverLifecycle.getWebDriver(SingleUseDriverLifecycle.java:34) ~[frameworkium-core-4.1.0.2.jar:?]
at com.frameworkium.core.ui.UITestLifecycle.getWebDriver(UITestLifecycle.java:149) ~[frameworkium-core-4.1.0.2.jar:?]
at com.frameworkium.core.ui.listeners.ScreenshotListener.takeScreenshotAndSaveLocally(ScreenshotListener.java:45) ~[frameworkium-core-4.1.0.2.jar:?]
at com.frameworkium.core.ui.listeners.ScreenshotListener.onTestSkipped(ScreenshotListener.java:39) ~[frameworkium-core-4.1.0.2.jar:?]
at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:87) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker.runTestResultListener(TestInvoker.java:220) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker.invokeListenersForSkippedTestResult(TestInvoker.java:447) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:547) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174) ~[testng-7.3.0.jar:?]
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) ~[testng-7.3.0.jar:?]
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128) ~[testng-7.3.0.jar:?]
at java.util.ArrayList.forEach(ArrayList.java:1507) [?:?]
at org.testng.TestRunner.privateRun(TestRunner.java:764) [testng-7.3.0.jar:?]
at org.testng.TestRunner.run(TestRunner.java:585) [testng-7.3.0.jar:?]
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384) [testng-7.3.0.jar:?]
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378) [testng-7.3.0.jar:?]
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337) [testng-7.3.0.jar:?]
at org.testng.SuiteRunner.run(SuiteRunner.java:286) [testng-7.3.0.jar:?]
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) [testng-7.3.0.jar:?]
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) [testng-7.3.0.jar:?]
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218) [testng-7.3.0.jar:?]
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) [testng-7.3.0.jar:?]
at org.testng.TestNG.runSuites(TestNG.java:1069) [testng-7.3.0.jar:?]
at org.testng.TestNG.run(TestNG.java:1037) [testng-7.3.0.jar:?]
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) [testng-remote.jar:?]
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) [testng-remote.jar:?]
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) [testng-remote.jar:?]
FAILED CONFIGURATION: @BeforeMethod configureBrowserBeforeTest(public void CTSmoke.ClaimFolder.tc01ManageMyReminders())
java.lang.NoClassDefFoundError: org/openqa/selenium/internal/Require
at org.openqa.selenium.chromium.ChromiumOptions.setExperimentalOption(ChromiumOptions.java:185)
at ChromeCapability.ChromeDeviceCapabilitiesForJenkins.getCapabilities(ChromeDeviceCapabilitiesForJenkins.java:28)
at ChromeCapability.ChromeDeviceCapabilitiesForJenkins.getCapabilities(ChromeDeviceCapabilitiesForJenkins.java:14)
at com.frameworkium.core.ui.driver.AbstractDriver.initialise(AbstractDriver.java:56)
at com.frameworkium.core.ui.driver.DriverSetup.instantiateDriver(DriverSetup.java:34)
at com.frameworkium.core.ui.driver.lifecycle.SingleUseDriverLifecycle.initBrowserBeforeTest(SingleUseDriverLifecycle.java:29)
at com.frameworkium.core.ui.UITestLifecycle.beforeTestMethod(UITestLifecycle.java:81)
at com.frameworkium.core.ui.UITestLifecycle.beforeTestMethod(UITestLifecycle.java:99)
at com.frameworkium.core.ui.tests.BaseUITest.configureBrowserBeforeTest(BaseUITest.java:150)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:61)
at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:366)
at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:320)
at org.testng.internal.TestInvoker.runConfigMethods(TestInvoker.java:701)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:527)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1507)
at org.testng.TestRunner.privateRun(TestRunner.java:764)
at org.testng.TestRunner.run(TestRunner.java:585)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
at org.testng.SuiteRunner.run(SuiteRunner.java:286)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.runSuites(TestNG.java:1069)
at org.testng.TestNG.run(TestNG.java:1037)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.internal.Require
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

Loosen access to PageFactory constructor from private to protected

This useful for wrapping special conditions everytime a page is instantiated
Example below takes care of any async load everytime an page is returned

public class PageFactory extends com.frameworkium.core.ui.pages.PageFactory {
    public static <T extends BasePage<T>> T newInstance(Class<T> clazz, long timeoutInSeconds) {
        BaseTest.newWaitWithTimeout(GLOBAL_SCRIPT_TIMEOUT.seconds())
                .until(invisibilityOfSpinner());
        return com.frameworkium.core.ui.pages.PageFactory.newInstance(clazz, timeoutInSeconds);
    }

    public static <T extends BasePage<T>> T newInstance(Class<T> clazz) {
        return newInstance(clazz, Time.GLOBAL_PAGE_LOAD_TIMEOUT.seconds());
    }
}

Should the UITestRunner have alwaysRun set on afterMethod?

Describe the Issue
I've found that if an exception is thrown in the setUpClass or setTestName methods (annotated with @BeforeClass and @BeforeMethod respectively) of UITestRunner, then the subsequent test(s) are skipped, and so the afterMethod method doesn't execute. This meant that the Chrome session didn't get killed.

Adding alwaysRun=true to the @AfterMethod annotation seems to have resolved this issue.

Is there any downside to that which I might be missing? If not, I'm happy to submit a PR with that change in.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a BDD test project using Chrome as the browser.
  2. Cause an exception to be thrown during one of the @Before... methods in UITestRunner.
  3. Execute the UITestRunner.

Expected Behaviour
The test(s) should be skipped, and the Chrome session should be closed gracefully.

Versions (please complete the following information):

  • Frameworkium-core version: [e.g. 3.0.0]
  • OS: CentOS 7.6.1810
  • Browser: Chromium
  • Version: 71

Additional Context
Add any other context about the problem here.
I originally raised this in the Frameworkium BDD project's issues, but just realised that maybe they don't get much attention. Happy to delete either that one or this one

BaseTest().newWaitWithTimeout(timeout).until(Expected.Conditions....) no longer works with frameworkum 2.4.2

This is attributed to Selenium 3.4.0 vs Selenium 3.0.1

results in compilation error

 method until in interface org.openqa.selenium.support.ui.Wait<F> cannot be applied to given types;
[ERROR] required: java.util.function.Function<? super org.openqa.selenium.WebDriver,T>
[ERROR] found: org.openqa.selenium.support.ui.ExpectedCondition<java.lang.Boolean>
[ERROR] reason: cannot infer type-variable(s) T
[ERROR] (argument mismatch; org.openqa.selenium.support.ui.ExpectedCondition<java.lang.Boolean> cannot be converted to java.util.function.Function<? super org.openqa.selenium.WebDriver,T>)

When Frameworkium 2.4.2 is forced to downgrade to Selenium 3.0.1, it will compile

Remove 'test' scope on cucumber-java dependency

Please remove 'test' scope on cucumber-java dependency.

This will allow Frameworkium to pull in the dependency via frameworkium-core rather than defining the cucumber-java dependency again in the frameworkium pom.

Allow BasePage to have a keyword that handles generic return page as a parameter

Issue

An interaction on an element would result in navigation to different pages depending on the input
Example:

  • On HomePage, setting a valid input to a TextBox and clicking Submit Button would navigate me to SuccessPage
  • On HomePage, setting a invalid input to a TextBox and clicking Submit Button would navigate me to FailPage

Current Implementations

Currently, developers would define multiple methods

//PO
public SuccessPage clickSubmitButtonAndGotoSuccessPage(){
return PageFactory.newInstance(SuccessPage.class);
}

public FailPage clickSubmitButtonAndGotoFailPage(){
return PageFactory.newInstance(FailPage.class);
}

...

public WhateverPage clickSubmitButtonAndGotoSomeOtherPage(){
return PageFactory.newInstance(WhateverPage.class);
}

Why it stinks

This bloats the PO and quickly becomes unreadable

Proposed solution

Have a method in BasePage

withExpectation(? BasePage<?>) 

method name should be change to something better

This allows me to write,

//PO
public BasePage clickSubmitButton(){
submitButton.click();
return PageFactory.newInstance(BasePage.class);
}
//Test with valid inputs
homePage.setTextBox("Good Input");
SuccessPage successPage = homePage.clickSubmitButton().withExpectation(SuccessPage.class);

//Test with invalid inputs
homePage.setTextBox("Good Input");
FailPage failPage = homePage.clickSubmitButton().withExpectation(FailPage.class);

This would allow me to reuse clickSubmitButton

I am just throwing out ideas, I am open to a better implementation

Add ability to add defect ticket references for failed tests when updating with zapi

On a JIRA ticket test executions has a field for 'Defects'. I have automated tests which fail for known bugs so wish to update those executions as failed using zapi automatically and also add the defect ticket number.

One logical approach would be to reserve @testcaseid for the JIRA ID of the test case and use @issue to tag bugs related to that test case. This is how the two tags are intended, allure use a 'bug' icon against any IDs added with the @issue tag.

Currently you cannot add an @issue tag with an ID which does not match the @testcaseid. (see method getIssueOrTestCaseIdValue) Can this restriction be lifted ? I understand some projects may have treated Issue/TestCaseId as the same thing so there may be some backwards incompatability questions...

Click on non-visible links by default

Description
I am automating a web app where there are a lot of links that are visible when you scroll down. I want frameworkium to click on these links without having to use the forceVisible and executeJS block every time for this.

To Reproduce
Steps to reproduce the behavior:

  1. Launch a web app where there a lot of links at the bottom only visible when you scroll down
  2. Use .click()
  3. See error: Link not clickable

Workaround
You need to keep using this block to make the element and then click or perform any action on it -

       WebElement somelink = driver.findElement(By.linkText("some link"));
       forceVisible(somelink);
       executeJS("arguments[0].scrollIntoView(true);", somelink);
       somelink.click();

Expected Behaviour
Should click on the link (or do any other action on an element) wherever it is located in the app (as long as it is enabled)

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Frameworkium-core version: 3.0.0
  • OS: Win/Mac
  • Browser: Chrome
  • Version: 100.0.4896.60

Timeouts on master causing NoSuchMethodError

When pulling latest master tagged as 4.0.0-BETA2-SNAPSHOT and trying to run TheInternetExampleTests (with a modified ru.yandex.qatools.htmlelements version due to selenium 4 update issues), the following error is shown :

java.lang.NoSuchMethodError: 'org.openqa.selenium.WebDriver$Timeouts org.openqa.selenium.WebDriver$Timeouts.setScriptTimeout(java.time.Duration)'

	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringTimeouts.setScriptTimeout(EventFiringWebDriver.java:708)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringTimeouts.setScriptTimeout(EventFiringWebDriver.java:703)
	at com.frameworkium.core.ui.driver.AbstractDriver.setupEventFiringWebDriver(AbstractDriver.java:69)
	at com.frameworkium.core.ui.driver.AbstractDriver.initialise(AbstractDriver.java:56)
	at com.frameworkium.core.ui.driver.DriverSetup.instantiateDriver(DriverSetup.java:34)
	at com.frameworkium.core.ui.driver.lifecycle.SingleUseDriverLifecycle.initBrowserBeforeTest(SingleUseDriverLifecycle.java:29)
	at com.frameworkium.core.ui.UITestLifecycle.beforeTestMethod(UITestLifecycle.java:81)
	at com.frameworkium.core.ui.UITestLifecycle.beforeTestMethod(UITestLifecycle.java:99)
	at com.frameworkium.core.ui.tests.BaseUITest.configureBrowserBeforeTest(BaseUITest.java:150)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:61)
	at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:366)
	at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:320)
	at org.testng.internal.TestInvoker.runConfigMethods(TestInvoker.java:701)
	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:527)
	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.testng.TestRunner.privateRun(TestRunner.java:764)
	at org.testng.TestRunner.run(TestRunner.java:585)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
	at org.testng.TestNG.runSuites(TestNG.java:1069)
	at org.testng.TestNG.run(TestNG.java:1037)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)

This might be due to the deprecation of setScriptTimeout(long time, TimeUnit unit) in Selenium4, instead using setScriptTimeout(Duration duration).

Expected outcome:

  1. Start test suite
  2. Driver generated
  3. Test runs

Allure's Issues tag not supported.

More of an improvement.

currently the

@Issue("jira ID")

works correctly and very well. but occasionally i would like to mark off multiple jira tests with one test.I have some tests that require 2 parts of the system to work together in order to work, if the test is successful i would like it to mark off the results for both of the tests in jira. Allure has the functionality for multiple issue IDs in the form.

@Issues({
    @Issue("jiraId 1"),
    @Issue("jiraid 2")
})

when you then perform the getAnnotation(Issues.class).value() this will return an array of Issue objects that you can iterate over to update Jira. from what i can see, a small edit to the ZapiListener class would make this possible.

Reusing the same browser across multiple tests

Hi this is not really an issue, just an "annoyance"

Is there a way with frameworkium, that I can load the browser once and use the same browser instance for all tests, rather than having each test spin it up and then shutting it down?

[Appium Remote] 400 The plain HTTP request was sent to HTTPS port

Hello,

I seem to be getting the following error when I try and create a Custom Browser Implementation.

[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 4.05 s <<< FAILURE! - in TestSuite
[ERROR] instantiateDriverObject(com.what3words.tests.MapTest) Time elapsed: 3.744 s <<< FAILURE!
org.openqa.selenium.WebDriverException:
Unable to parse remote response:

<title>400 The plain HTTP request was sent to HTTPS port</title>

400 Bad Request

The plain HTTP request was sent to HTTPS port
nginx/1.12.1

I tried to look online for solutions to this problem without luck. Please could you help me out explaining when I create a simple class with a main object and I instantiate my driver etc it has no issues with the ssl problem??

CustomDriverImpl source -> https://pastebin.com/JTJsTB4r

Thanks Arjun

Find all usage of RestAssured and create proxy properties for each

Describe the Issue
We currently just have one option to specify a proxy (-Dproxy) and this sets it for Selenium (browsers) as well as all instances of RestAssured. This might not suit all network set ups. e.g. If your SUT needs a proxy but your Jira doesn't. Or if your UI needs a proxy but your API tests don't.

Expected Behaviour
A file or set of fine grained options for setting the proxy for each use case.

ExtraExpectedConditions.sizeGreaterThan does not accept controls from ru.yandex.qatools.htmlelements.element

Describe the Issue
It is not possible to pass in a List of Links (ru.yandex.qatools.htmlelements.element.Link) into the ExtraExpectedConditions.sizeGreaterThan(List list, int expectedSize) method.
NB: This is not be unique to Link but also other controls from the same package AND it is not restricted to just this method.

To Reproduce
Steps to reproduce the behaviour:

  1. Having a PageObject that has a field representing a list of Links
  2. attempt to use a wait.until passing in an extra expected condition as per description above
  3. code will not compile and displays a wrong argument type error

Expected Behaviour
It should be able to receive an object that inherits from WebElement

Screenshots
NA

Versions (please complete the following information):

  • Frameworkium-core version: 3.0.0 BETA
  • OS: NA
  • Browser NA
  • Version NA

Additional Context
NA

Cannot use 'driver' in components

Currently cannot use the injected 'driver' in the components - meaning for shared menus that require hovering we cannot use the 'moveToElement' type methods.

Either need to find a way to have this injected here too, or need to give an example where we can use it (a getDriver() call, for example?)

Unable to run test in Edge

Summary
I cloned 2.7.2 frameworkium-core and try to run using TestNg but it returns an error org.openqa.selenium.WebDriverException: Unable to parse remote response: Unknown error. It's only open edge browser but not return the URL. It is working fine when code is written in selenium way(not sure what its called, test, and CSS selector in the same page).

To Reproduce
Steps to reproduce the behavior:

  1. Set in VM options -Dbrowser=edge
  2. Click Run
  3. org.openqa.selenium.WebDriverException: Unable to parse remote response: Unknown error

Expected Behaviour
Expecting it to open a browser with URL.

Screenshots
image

Versions (please complete the following information):

  • Frameworkium-core version: 2.7.2
  • OS: Windows 10
  • Browser : Edge
  • Version 81.0.416.68 (Official build) (64-bit)

Additional Context
Add any other context about the problem here.

driver-binary-downloader-maven-plugin always runs

The driver-binary-downloader-maven-plugin always seems to run e.g. in CI when doing a mvn verify or even a mvn test locally.

I didn't think this was desired behaviour, I thought it should only run on mvn selenium? The current behaviour may cause issues with proxies or no Internet.

[Mobile Web] Support for running mobile web tests on Android & iOS locally.

Hello,

Either I have missed how to run mobile web tests on andorid and ios locally. I checked the code base I can't find Android Driver / iOS driver implementations within the framework.

I was wondering

a.) Is there a way to run mobile web tests using Frameworkium on real devices locally?
b.) If not, what is required to implement the functionality within Frameworkium

On a side note, I love your framework!

Thanks Arjun

Create issue template against documentation requests

Is your feature request related to a problem? Please describe.
Add documentation template for improvement requests
Ensure public is able to pull request on frameworkium doc repo

Describe the solution you'd like
When public has an bug/feature request against documentation, present them with a documentation template.
Present a reasonable checklist

Describe alternatives you've considered
Example https://github.com/allure-framework/allure2/blob/master/.github/ISSUE_TEMPLATE/documentation.md

Additional context
Nil

JIRA logging does not work when a test is tagged with multiple TmsLink annotation

Description
When I tag a test with multiple @TmsLink annotations
And I enable logging to jira/zephyr
Then I expect both test to be logged to jira
Instead both test are not logged to jira

Example code below:

    @Test    
    @TmsLink("ABC-170")
    @TmsLink("ABC-177")
    public void this_tests_two_tickets_at_once() {
        //code
     }

To Reproduce

  1. Tag a test with multiple @TmsLink annotation
  2. Execute test with logging to jira enabled
  3. Observe jira to confirm logging

Expected Behaviour
All @TmsLink annotations should be respected and logged to jira

Screenshots

  • NA -

Versions:

  • Frameworkium-core version: 3.0.0
  • OS: Windows 7
  • Browser: Chrome
  • Version: 73.0.3683.75

Additional Context

  • NA -

Modify the default wait time for @Visible annotations

Per my question on StackOverflow: https://stackoverflow.com/questions/59052480/is-there-any-way-to-increase-the-default-wait-in-frameworkium-for-visible-anno

I presume there's no way to increase the default timeout while waiting for an element to be @Visible, since this seems to be hard-coded in UITestLifecycle. Is that correct? Is there any workaround besides not using that annotation and doing it the 'standard' Selenium way (in which case I'm not sure the benefits of Frameworkium would outweigh the downsides).

Creating a custom browser implementation does not work

An attempt was made to create a edge custom browser implementation as follows as below:

public class EdgeImpl extends AbstractDriver
{

    @Override
    public EdgeOptions getCapabilities()
    {
        EdgeOptions edgeOptions = new EdgeOptions();
        edgeOptions.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
        edgeOptions.setCapability("requireWindowFocus", true);
        return edgeOptions;
    }

    @Override
    public WebDriver getWebDriver(Capabilities capabilities)
    {
        final EdgeOptions edgeOptions;
        if (capabilities instanceof EdgeOptions)
        {
            edgeOptions = (EdgeOptions) capabilities;
        }
        else
        {
            edgeOptions = new EdgeOptions().merge(capabilities);
        }
        return new EdgeDriver(edgeOptions);
    }
}

This file was including in the utils folder of the test repo.

However on attempt to use it with the below command:

mvn install verify -Denvironment=${Environment_SA} -DcustomBrowserImpl=EdgeImpl -P smoke-tests -pl test-smoke -DvideoCaptureUrl=http://${SLAVE_IP}:3000/download_video/%s.mp4 -Dsurefire.suiteXmlFiles=testsuite/SampleSingleTest.xml -DgridURL=http://${SLAVE_IP}:4444/wd/hub -am

An error was generated:

FAILED CONFIGURATION: @BeforeMethod instantiateDriverObject
java.lang.IllegalArgumentException: Problem loading custom browser implementation: EdgeImpl
        at com.frameworkium.core.ui.driver.DriverSetup.lambda$getCustomBrowserImpl$1(DriverSetup.java:165)
        at java.util.Optional.orElseThrow(Optional.java:290)
        at com.frameworkium.core.ui.driver.DriverSetup.getCustomBrowserImpl(DriverSetup.java:165)
        at com.frameworkium.core.ui.driver.DriverSetup.createDriverImpl(DriverSetup.java:88)
        at com.frameworkium.core.ui.driver.DriverSetup.instantiateDriver(DriverSetup.java:39)
        at com.frameworkium.core.ui.tests.BaseTest.instantiateDriverObject(BaseTest.java:98)
        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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
        at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
        at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:451)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:516)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:707)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:979)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Creating a custom browser implementation as documented: https://frameworkium.github.io/#_pages/Custom-Browser-Implementations.md

No longer seems to work.

Aysnchronous script timeout

There is a bug which often crops on angularJS pages, which reads

TimeoutException: asynchronous script timeout: result was not received in 10 seconds

Updating the ngwebdriver dependency to 0.9.7 seems fix this

<dependency>
  <groupId>com.paulhammant</groupId>
  <artifactId>ngwebdriver</artifactId>
  <version>0.9.7</version>
  <scope>test</scope>
</dependency>

@Name annotation throw default value exception

Hi team

Recently I have updated frameworkium 4.1.0.2 vertion once I update my pom file it's throw exception all my page object class than I have to import web elements for respective package and my code is unable to run because of issues @name anotion throw some default value missed exception and chrome options exception kindly help us ASAP

Electron driver does not work

Trying to run an automated test using electron fails. Trying to run a test comes up with this:

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Drivers throw 'Frameworkium unable To Take Screenshot' errors when really it's that the driver hasn't been able to get a browser etc

I wonder whether we could protect from this a little better, as the error messages about selenium not actually working (As is currently the case with the latest ff) get lost as we fail the test then try to take a screenshot. Likewise when using cucumber - we actually driver.quit() before the @after from basetest kicks in - meaning there's then no driver when it comes to take it's screenshot on failure.

Capture does not recognize multiple TmsLink or Issue annotations per method

Describe the Issue
When test methods are annotated with multiple @TmsLink or @issue, it get ignored

To Reproduce
Steps to reproduce the behavior:

  1. Set multiple @TmsLink or @issue per test method
  2. Enable capture
  3. Observe that capture does not recognize multiple annotations

Expected Behaviour
Capture API should update for multiple annotations

Screenshots
NA

Versions (please complete the following information):

  • Frameworkium-core version: 3.0.1
  • OS: Windows 7
  • Browser Chrome, Firefox

Additional Context
NA

Allure's Issues tag not supported.

More of an improvement.

currently the

@Issue("jira ID")

works correctly and very well. but occasionally i would like to mark off multiple jira tests with one test.I have some tests that require 2 parts of the system to work together in order to work, if the test is successful i would like it to mark off the results for both of the tests in jira. Allure has the functionality for multiple issue IDs in the form.

@Issues({
    @Issue("jiraId 1"),
    @Issue("jiraid 2")
})

when you then perform the getAnnotation(Issues.class).value() this will return an array of Issue objects that you can iterate over to update Jira. from what i can see. with a small edit to the ZapiListener class would make this possible.

Electron driver intermittent issues

Note: Issue is for tracking and visibility in-case this is discovered by someone else during my investigation/fix.

When running Electron driver remotely with 'gridURL' defined, tests are executed properly, and correctly, until randomly one test will report an error, then subsequently after that the rest of the tests fail.

First error:

13:42:23.451 [main] ERROR com.frameworkium.listeners.ScreenshotListener - Unable to take screenshot - org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()?

Subsequent errors after that:

13:43:36.115 [main] ERROR com.frameworkium.listeners.ScreenshotListener - Unable to take screenshot - org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html

Due to tests working properly before this, It's quite baffling. Looking into it.

Selenium 3.5 is not compatible with the Frameworkium 2.4

I have attempted to bump Selenium to 3.5 and waits started to throw errors

ERROR - org.openqa.selenium.support.ui.Wait.until(Lcom/google/common/base/Function;)Ljava/lang/Object; java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.Wait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

It has something to do with this
SeleniumHQ/selenium#3606

@Visible tag with List<WebElement> s does not behave as expected

The code currently tries to just check for visibility of the first webelement in the list; but sometimes this list does not contain any elements. A workaround is to have a @visible check for a single webelement using the same selector - suspect we can try to wrap the same functionality does into the basepage layer rather than explicitly having to define an element that then doesn't get used.

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.