Git Product home page Git Product logo

cypress-automation_task_imbd's Introduction

JS automation tests with Cypress framework

Test statuse badge:

This repository purpose is to perform test automation on IMDB.com website with the following scenarios:

  1. Go to IMDb.com, search for Nicolas Cage and access his profile; then sort filmography by Rating, and include only Feature Film. (imdb.actor_filmography.cy.js file)

  2. Go to IMDb.com, click on the 2nd item on the Top box office list; then click on the Rate, set 5 stars Rating and click on the Rate button. (imdb.top_box_office.cy.js file)

  3. Go to IMDb.com, click on the Menu button, and navigate to the Top 250 TV Shows section; then click on Breaking Bad, go to the Photos, display only Danny Trejo's photos, and then click on the 2nd photo in the list. (imdb.top250_tv_shows.cy.js file)

If you want to use another parameters in the test ('actor', 'TV show actor' and 'TV show name') please change actorName, tvShowActorName, tvShowTitle, tvShowfoto, topBoxFilm, filmRate variables in cypress.config.js, or pass with --env flag through the command line (dot separated). For example "npx cypress run --env actorName=Billy.Bob.Thornton,tvShowActorName=Billy.Bob.Thornton,tvShowTitle=Fargo,tvShowFoto=1,topBoxFilm=3".

Report page (available if repository is public) https://valiantsin2021.github.io/Cypress-Automation_Task_IMBD/

Job done:

Cypress

  1. Page Object Model and Environment variables
  2. Constants in a separate file
  3. Mochawesome report (mochawesome-report dir)
  4. Github Actions yml file
  5. Jenkiinsfile with pipeline script to run tests in docker container
  6. DockerFile to run in docker container
  7. All methods are made universal for reusability reason with the different test scenarios (depends on "film actor name", "TV show", "TV show actor name")
  8. Cypress dashboard connected
  9. Precommit hook to run Prettier/Eslint for auto code formatting before commit
  10. Add data driven test suite (use data file to dynamically create test cases)
  11. Add allure report ( to generate HTML report - "npm run allure")

Setup:

  1. Clone this repository
  2. Navigate to the folder of cloned repository and run terminal
  3. Install dependencies with "npm install"
  4. To run tests headless with report generated - "npm test"
  5. To run tests using the Launchpad - "npx cypress open"
  6. To run only data driven test suite - "npm run test:dd"
  7. To run in free mode with allure reporter - "npx cypress run --env allure=true --spec "
  8. To run env_driven test suite axample "npx cypress run --env actorName=<Billy.Bob.Thornton>,tvShowActorName=<Billy.Bob.Thornton>,tvShowTitle=,tvShowFoto=<1>,topBoxFilm=<3>"
  9. To run env suite with dashboard - "npm run cy:dashboard"
  10. To make history allure report run "mkdir allure-results/history || echo "history folder already in place...continuing :)" && cp allure-report/history/* ./allure-results/history && echo "Allure trends updated!" allure generate allure-results --clean -o allure-report && allure open allure-report"
  11. To generate Allure HTML report - "npm run allure"

To run test dockerized:

  1. Clone this repository , navigate to the folder of cloned repository and run terminal
  2. "docker build -t ." (to build image)
  3. "docker start " to run container
  4. "docker run -it --rm --name -v ${PWD}:/e2e -w /e2e --entrypoint=cypress cypress/included:10.11.0 run"
  5. "docker image rm " to remove image

To run the image from Docker Hub:

  1. "docker pull valiantsin2022/valentin_lutchanka_automation_test"
  2. "docker run -it --rm --name valentin_lutchanka_automation_test -v ${PWD}:/e2e -w /e2e --entrypoint=cypress cypress/included:10.11.0 run"
  3. "docker image rm valiantsin2022/valentin_lutchanka_automation_test" to remove image

To run with sorry-cypress

Setup: npm install cy2 cypress (windows) npm install cross-env export CYPRESS_API_URL="http://localhost:1234/" npx cross-env CYPRESS_API_URL="http://localhost:1234/" cy2 run --parallel --record --key somekey --ci-build-id hello-cypress

We are going to run the full sorry-cypress kit: director service will use MongoDB to store the test runs and the results API service (a GraphQL interface to MongoDB) to let us issue queries and retrieve tests results Dashboard service - a web dashboard for browsing the results minio will let us store files - videos and screenshots generated by cypress agent We are going to run all the services locally using docker-compose

get docker-compose file

curl --output docker-compose.minio.yml https://raw.githubusercontent.com/sorry-cypress/sorry-cypress/master/docker-compose.minio.yml

start the services

docker-compose -f ./docker-compose.minio.yml up For each spec file open new terminal and run

CYPRESS_API_URL="http://localhost:1234/" npx cy2 run --parallel --record --key somekey --ci-build-id hello-cypress

After successfully running docker-compose, we have: director service on http://localhost:1234 API service on http://localhost:4000 Dashboard running on http://localhost:8080 (change to 8081 if your jenkins runs on 8080) Open the dashboard at http://localhost:8080 (change to 8081 if your jenkins runs on 8080)

cypress-automation_task_imbd's People

Contributors

renovate[bot] avatar valiantsin2021 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

kryvchenko

cypress-automation_task_imbd's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency cypress to v12
  • Update dependency rimraf to v5
  • Update mongo Docker tag to v6
  • Update peaceiris/actions-gh-pages action to v3
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.minio.yml
  • mongo 4.4
dockerfile
Dockerfile
  • cypress/included 10.11.0
github-actions
.github/workflows/automerge.yml
  • pascalgn/automerge-action v0.15.6
.github/workflows/cypress.yml
  • actions/checkout v3
  • actions/setup-node v2
  • actions/upload-artifact v3
  • peaceiris/actions-gh-pages v2
npm
package.json
  • cross-env ^7.0.3
  • cy2 ^3.2.0
  • @shelex/cypress-allure-plugin ^2.34.0
  • cypress ^10.11.0
  • cypress-mochawesome-reporter ^3.2.3
  • eslint-config-prettier ^8.5.0
  • eslint-plugin-chai-friendly ^0.7.2
  • eslint-plugin-cypress ^2.12.1
  • eslint-plugin-prettier ^4.2.1
  • husky ^8.0.0
  • prettier 2.7.1
  • pretty-quick ^3.1.3
  • rimraf ^3.0.2

  • Check this box to trigger a request for Renovate to run again on this repository

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.