Giter VIP home page Giter VIP logo

wr-52.taqc-java-testproject's Introduction

Wr-52.TAQC-Java-TestProject

Wr-52.TAQC/Java/Python Test Project for EventExpress Web-App

Link to EventExpress Website:

https://eventsexpress-test.azurewebsites.net/landing

For contributors

Git Flow

We are using simpliest github flow to organize our work: Git Flow Ilustration

Note! Contribution rules:

  1. All Pull Requests should start from prefix #xxx-yyy where xxx - task number and and yyy - short description e.g. #020-CreateAdminPanel.

  2. Pull request should not contain any files that are not required by the task. In case of any violations, the pull request will be rejected.

  3. Create a .env file at the project’s root directory for credentials, add the following fields:
    EMAIL="[email protected]"
    PASSWORD="validpassword"

    ADMIN_EMAIL="[email protected]"
    ADMIN_PASS="validpassword"

    UNCONFIRMED_ACCOUNT_EMAIL="[email protected]"
    UNCONFIRMED_ACCOUNT_PASSWORD="validpassword"

  4. The project uses Chrome as default browser. You can run it with a different browser by adding argument to mvn command (e.g. -Ddriver=edge for Edge browser). See systemPropertyVariables in pom.xml and DriverManager.

  5. Allure report by existing XML files will be generated during Maven build process.

    • mvn clean test to run your tests

    You can generate a report using the following command:

    • mvn allure:serve report will be generated into temp folder. Web server with results will start.

Once the changes have been made on develop branch, the most recent Allure test report will be published at this link: https://servettonga.github.io/Wr-52.TAQC-Java-TestProject/

wr-52.taqc-java-testproject's People

Contributors

servettonga avatar neonilah avatar vtelt avatar muyanjakevin avatar thoughtseize1 avatar

Watchers

 avatar  avatar

Forkers

muyanjakevin

wr-52.taqc-java-testproject's Issues

Refactor ConfigurationManager

  1. The configs field could be an inline variable (inside the getConfig() method.
  2. Instead of referencing it from the file new File("src/test/resources/test.properties") it would be better to use Resource, as it is more abstract and will work also if the project get's packaged in a jar

public class ConfigurationManager {
protected static Configurations configs = new Configurations();
protected static Configuration config;
public static Configuration getConfig() {
if (config == null) {
try {
config = configs.properties(new File("src/test/resources/test.properties"));
} catch (ConfigurationException e) {
System.out.println("Configuration file not found");
e.printStackTrace();
System.exit(1);
}
}
return config;
}
}

Allure setup

Create a base allure setup.

  1. Create a test that uses it
  2. Document the process of setting it up locally in README.md

Add empty `.env` file and document it

.env file is required to run the tests.

  • create an empty (or a dummy) .env file in the correct place
  • expand README.md with the fields that are required there

Refactor TestSetUp

  • Rename TestSetUp to BaseTest, so it's more meaningful. Also make it abstract
  • constant names should be written in UPPERCASE

Introduce @FindBy and PageFactory

Instead of looking for the elements "by hand" a useful annotation could be used instead.

This how it looks in action:

import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.FindBy;
 import org.openqa.selenium.support.PageFactory;
 
 public class LandingPage {
 
     @FindBy(css = "#Content a")
     private WebElement enterStoreLink;
 
     private WebDriver driver;
 
     public LandingPage(WebDriver driver) {
         this.driver = driver;
         PageFactory.initElements(driver, this);
     }
 
     public void clickOnEnterStoreLink() {
         enterStoreLink.click();
     }
 
 }

Refactor current pages to make use of this.

Introduce Faker library

Currently, the project has its own implementation of randomizing data, as shown in the snipped below.

public static List<String> randomUser() {
List<String> user = new ArrayList<>();
String email = "";
String password = "";
final String[] letters = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
"X", "Y", "Z" };
final String[] numbers = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
final String[] symbols = { "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "-", "=", "~" };
for (int i = 0; i < 5; i++) {
email += (letters[(int) (Math.random() * letters.length)]
+ numbers[(int) (Math.random() * numbers.length)]);
password += (letters[(int) (Math.random() * letters.length)]
+ numbers[(int) (Math.random() * numbers.length)]
+ symbols[(int) (Math.random() * symbols.length)]);
}
user.add(email + "@gmail.com");
user.add(password);
return user;
}

As mentioned by @ignatenko-paul it's a good idea to introduce Faker to do the job for you.

The goal of this issue is to replace the mentioned implementation with Faker.

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.