What are the pros and cons of bundling webdriver-io with the main application at test? - webdriver-io

What are the cons and pros of bundling webdriver-io with the main application at test?
The question is based on the assumption that webdriver-io could be run as a stand-alone application, but also bundled together with the main application (similar to Cypress).

WebdriverIO comes in two flavors , one is runner and another is standalone.
Runner is a framework which has all boiler plate codes for reporting , integration etc already done for you.
standalone mode is just like selenium , its just a http client library that calls w3c protocol under the hood .
so what flavor you use depends on your use case. For end to end test we usually prefer runner . while if you already have a framework in place then you can use wdio standalone as a replacement of webdriverjs

Related

Running all Tests in Production Template in Shopware 6.3.5.2

We are building a shop for a customer on Shopware 6.3.5.2 and want to use tests to
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
There is Running End-to-End Tests but this seems to be for core development and uses psh.phar which is not available in the production template.
How should this be done?
edit
This question is meant a bit broader and concerns also Unit Tests.
Actually, you can use the E2E tests of the platform project - as Cypress itself doesn't care where to run the test against. However, as you already noticed you cannot use psh commands to run them. You may run the tests though the basic Cypress commands, setting your shop's url as baseUrl of the tests, for example via this command:
./node_modules/.bin/cypress run --config baseUrl="<your-url>"
It works with cypress open as well.
The only thing what may become troublesome is the setToInitialState command in most of the tests which takes care about the clean up of shopware's database using psh scripts, unfortunately. You may need to adjust it by overriding the command in order to reset the database of the Production template.
I hope I was able to help a bit. 🙏
There are actually two parts here:
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
re 1: For regression tests like this I would suggest end-to-end tests. Either test through the UI with tools like selenium or through the HTTP API (I don't know if the shopware API is sufficient for extensive regression tests).
re 2: Since plugins do not run on their own I would extract all relevant functionality into plain old PHP classes that are independent of shopware and test those in isolation. Explore if some of that functionality can be made visible through an API and test the plugin integration through this. Depending on the actual plugin you might have to resort to UI tests again.

QUERY: Using Karate DSL with javascript based UI automation framework

I want to know, if we can use karate with JS based UI automation framework. And if yes, what are the requisite to follow. Do we require maven in that case?
We have well matured UI automation Selenium based framework. We want to know, if we can integrate Karate DSL without using maven.
You might if you use the CLI (command line interface) provided by the stand-alone JAR / executable. Please read the documentation here: https://github.com/intuit/karate/tree/master/karate-netty#standalone-jar
Which means if you can call an OS command from node / JS - you can use Karate. But there are no guarantees - and you can assume the answer to your question is NO.
That said - we plan to have our own competitor to Selenium - but it will take a little more time: https://github.com/intuit/karate/tree/master/karate-core

Is there any framework which supports Behaviour driven approch (bdd) for selenium-webdriver with driver managment?

I want to start my automation project from scratch, as per requirements I have to use Behavior Driven Approach for testcase authoring and selenium for Automation. please suggest best suited framework.
You can check open source QMetry Automation Framework for web (selenium-webdriver) and mobile (appium) automation. It has all the features driver management, parallel execution, run configuration you want and many more like data-driven testing, data-bean, locator repository, integration with third party tools (CI, Test Management tools etc).
It support BDD, keyword-driven and coded (TestNG test) approach for authoring test cases. So you can opt bdd for test authoring.
You also will find inbuilt bdd steps ready to use for selenium webdriver and rest-webservices with the framework.
You can start by downloading blank project from git which uses ANT and IVY. If you want to use maven you can download qaf-blank-project-maven.
For getting started follow step-by-step-tutorial

Spring integration testing without XML

Could anyone provide a complete flow test example (channels, gateways, etc) using jUnit4 or other Test tool for spring integration? I am working without XML, thus I prefer a Java-config test initiation.
It depends on your application; for pure annotation configuration start with this framework test class, it has lots of tests.
If you're using the Java DSL, start here.

How does Arquillian compare to Pax Exam for OSGi (integration) testing?

I am currently investigating how best to test our OSGi application intended to run on Apache Karaf. The obvious option is Pax Exam with labs-paxexam-karaf (see http://iocanel.blogspot.com/2012/01/advanced-integration-testing-with-pax.html for a tutorial). However, I am concerned about performance (since Pax Exam apparently starts a new framework for every test method). I've also found that Arquillian has some OSGi support, though that isn't its main focus. JUnit4osgi isn't an option, as it only supports JUnit 3.
For someone unfamiliar with either framework, which is better to start with? What are the tradeoffs?
Why use Arquillian if you're after proper OSGi support? =)
When looking at PaxExam make sure the docs refer to PaxExam 2 - there are substantial differences between v 1 and 2.
PaxExam will take a while to get to grips with, but you'll learn heaps about OSGi in the process (definitely a good thing, but can still hurt).
In parallel to #Dmytro's answer, the Test Containers include a Native container which is run with the same VM as the junit test - meaning you can launch with debug in Eclipse. This works especially well with the org.eclipse.m2e:lifecycle-mapping maven eclipse plugin and the org.ops4j.pax.exam:maven-paxexam-plugin. This method is fantastic, complete IDE integration.
PaxExam documentation is a bit sparse, but there are some good examples (see the Native launcher with main method that provides interactive shell) and wiki doc. If you get stuck the mailing list people (general#lists.ops4j.org) are very helpful.
Another alternative is to look at Karaf's paxexam, very slick and easy to get a Karaf instance up and running (features.xml etc).
Personally, I just use PaxExam2 as I'd prefer to have no explicit dependencies on the framework provider (nothing against Karaf at all, it rocks).
Based on Reactor Strategies Pax-Exam can run all test methods in the same OSGi container.
The EagerSingleStagedReactorFactory of Pax Exam 2.x (aliased to PerClass in Pax 3.0) lets you run all test methods of a given class in the same OSGi container.
With the PerSuite strategy introduced in Pax Exam 3.0.0.M1, all test classes of your suite run in the same container.
By the way, Pax Exam 3.0 supports Java EE and CDI containers in addition to OSGi, so there is even more functional similarity with Arquillian, only Pax Exam is coming from the opposite end.
With Pax Exam, there is no need to assemble deployments in ShrinkWrap style, they are built automatically from the classpath. Moreover, you can run suites of test classes with a shared configuration.