Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 12b4d765 authored by rui rodrigues's avatar rui rodrigues
Browse files

add test runners according the projects

parent 1610fe0b
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 24 deletions
......@@ -12,8 +12,10 @@
- [Scenario outline](#scenario-outline)
- [How to Run tests](#how-to-run-tests)
- [How to generate html report](#how-to-generate-html-report)
- [How to add properties file](#How-to-add-properties-file)
- [Conventions](#conventions)
## About PSO-testing
The PSO-testing is a automated test framework designed to allow automate test cases about Commission European projects.
......@@ -148,12 +150,20 @@ Scenario Outline: a user <userStatus> logs in
### How to run tests
Run the following command
To simplOpen project
```bash
// to api testing
mvn clean test -Dtest=ApiRunnerTest
mvn clean test -Dtest=ApiSimplOpenRunner
// to ui testing
mvn clean test -Dtest=UiRunnerTest
mvn clean test -Dtest=UiSimplOpenRunner
```
To simplLabs project
```bash
// to api testing
mvn clean test -Dtest=UiSimplLabsRunner
```
### How to generate html report
......@@ -177,6 +187,12 @@ byte[] screenshot = page.screenshot(new Page.ScreenshotOptions());
scenario.attach(screenshot, "image/png", <title>);
```
### How to add properties file
- Go to directory src/main
- Create a file with name resources
- Add a file with name config.properties
- Add the information that is needed
### Conventions
- cucumber tags: each feature file should be a tag with feature name and each test should be tag with test case number and initial letter of feature name (eg. L01 - first scenario to login.feature).
- write typing:
......
package configuration.ui.data;
import framework.Config;
package configuration.ui.data.simplLabs;
import framework.common.Config;
public class Login {
public static final String URL = Config.get("URL");
......
package configuration.ui.data;
package configuration.ui.data.simplOpen;
public class Product {
public static final String BACKPACK_NAME = "Sauce Labs Backpack";
......
package configuration.ui.data;
package configuration.ui.data.simplOpen;
public class Wizard {
public static final String URL = "https://sd-creation-wizard.uatpso.com";
......
package configuration.ui.locators;
package configuration.ui.locators.simplLabs;
public class DataSpaces {
public static final String STATUS_FILTER = "mat-select[aria-haspopup='listbox']";
......
package configuration.ui.locators;
package configuration.ui.locators.simplLabs;
public class Login {
public static final String USERNAME = "id=username";
......
package configuration.ui.locators;
package configuration.ui.locators.simplOpen;
public class Wizard {
public static final String GET_STARTED_BUTTON= "Get Started";
......
package framework;
package framework.common;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class Config {
private static Properties properties = new Properties();
private static final Properties properties = new Properties();
static {
try (InputStream input = Config.class.getClassLoader().getResourceAsStream("config.properties")) {
......
......@@ -2,9 +2,8 @@ package helpers;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.SelectOption;
import static configuration.ui.locators.DataSpaces.*;
import static configuration.ui.locators.simplLabs.DataSpaces.*;
public class DataSpacesPage {
private final Page page;
......
package helpers;
import com.warrenstrange.googleauth.GoogleAuthenticator;
import static configuration.ui.data.Login.SECRET_KEY;
import static configuration.ui.data.simplLabs.Login.SECRET_KEY;
public class GoogleAuthenticatorHelper {
......
......@@ -2,7 +2,7 @@ package helpers;
import com.microsoft.playwright.Page;
import static configuration.ui.locators.Login.*;
import static configuration.ui.locators.simplLabs.Login.*;
public class LoginPage {
......
package stepDefinitions.api;
package stepDefinitions.api.simplOpen;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
......
package stepDefinitions.api;
package stepDefinitions.api.simplOpen;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
......
package stepDefinitions.ui;
package stepDefinitions.ui.simplLabs;
import com.microsoft.playwright.Page;
import framework.ui.UiSetup;
......@@ -9,7 +9,7 @@ import io.cucumber.java.en.When;
import io.cucumber.java.en.Then;
import org.junit.Assert;
import static configuration.ui.data.Login.*;
import static configuration.ui.data.simplLabs.Login.*;
public class DataSpacesSteps {
......
package stepDefinitions.ui;
package stepDefinitions.ui.simplLabs;
import com.microsoft.playwright.*;
import framework.ui.UiSetup;
......@@ -10,7 +10,7 @@ import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.junit.Assert;
import static configuration.ui.data.Login.*;
import static configuration.ui.data.simplLabs.Login.*;
public class LoginSteps {
private final Page page = UiSetup.getPage();
......
package stepDefinitions.ui;
package stepDefinitions.ui.simplOpen;
import com.microsoft.playwright.Page;
import framework.ui.UiSetup;
......@@ -7,8 +7,8 @@ import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import static configuration.ui.data.Wizard.URL;
import static configuration.ui.locators.Wizard.*;
import static configuration.ui.data.simplOpen.Wizard.URL;
import static configuration.ui.locators.simplOpen.Wizard.*;
public class WizardSteps {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment