Focus on writing good Test Automation
Forget about handling waits, iframes or overlay spinners. You can write concise, simple automation tests with Tidal Wave Automation Libary. No need to worry about dependency injection, object initializing, constructors etc..
Example:
Browser.open("https://google.com");
find("name:q").sendKeys("Tidal");
find("name:q").shouldHave(exactText("Tidal"));
Browser.close();
Need of a framework
What is the need for a framework? Usually during test automation scripting, a significant amount of code may need to be written to stabilize the execution. It is common for web applications to exhibit flakiness. Numerous environmental factors contribute to the sluggishness of our applications. Typical web applications consist of multiple AJAX components that load independently, providing users with a seamless experience. These components allow for page updates without requiring a full refresh. However, this poses a challenge for test automation libraries like Selenium, as they lack built-in wait times.
If these efforts can be reduced, the test automation engineers can focus more on designing better automation scenarios. The creative energy of the test automation engineer should focus on deriving the most efficient, faster tests rather than fixing the flakiness of the test run. Tidal - Wave test automation library is trying to achieve this. It is designed on the assumption that, there is no wait required initially expecting the element to be present in the application. If no element is found, it will enter the wait mode. It has a default wait time of 5 seconds which can be configured to a higher or lower value if needed.
Getting started
Dependencies
Tidal Wave UI automation library is built with Java and Selenium. It requires no additional setup other than downloading the maven dependency. For running tests, you can use any of your favourite test runner like Junit, TestNG etc.
Add the following Maven dependency to your pom.xml file
Tidal is hosted with Maven Central. For detailed version information, check the ‘Versions’ page under the ‘Detailed Docs’ section.
<dependency>
<groupId>dev.tidalcode</groupId>
<artifactId>wave</artifactId>
<version>2.0.1</version>
</dependency>
For projects using Gradle, use
implementation group: 'dev.tidalcode', name: 'wave', version: '2.0.1'
To start the browser
If you do not need any browser options
Browser.open(url); //This will start ChromeDriver as default
# .. after the test; call the close function
Browser.close();
To set your own max wait time
Browser.withWaitTime(Duration.ofSeconds(15));
To run tests in headless mode or to add any other browser options
//this example is for Chrome browser
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless=new");
Browser.withOptions(options); //add the option
To run with other browsers; for example
Browser.type("edge");
// combining all these options as an example for Edge browser
EdgeOptions options = new EdgeOptions();
options.addArguments("--headless=new");
Browser.withWaitTime(Duration.ofSeconds(15))
.type("edge")
.withOptions(options)
.open("https://google.co.nz");
// your test scripts would go here...
//finally
Browser.close();
The above is the hardest part required. But we need to do it only once. In most scenarios you would be putting the above script in a test hook and forget about it. The rest is easy.
find("name:q").sendKeys("Hello");
find("id:userName").sendKeys("my_username");
find("div with text 'hello world'").getText();
// to find multiple elements
findAll("linkText:User Names").get(3).click();
There is no extra effort needed to add waits, scripts to handle overlapping spinners, wait for background processes to finish. Just plain simple methods which would emulate user interactions.
Call simple static methods find()
and findAll()
to locate your element(s). If your element is inside an iframe, don’t worry; you do not need to switch to it. Tidal will find it. If you are blocked with a spinner and need to wait for it do disappear to click on an element, it will be handled. Just call the find()
method and the rest will be done for you.
About the project
Tidal is maintained by Philip Kurian(author) and other community contributors. For any queries regarding the framework or its usage pls write to [email protected]
License
Distributed by an MIT license.