Code Monkey home page Code Monkey logo

serenity-junit-tutorial's Introduction

Effective UI Test Automation With Serenity BDD and Selenium - Course Exercises

This repository contains the sample code for the Effective UI Test Automation With Serenity BDD and Selenium course on Udemy. Each module in the course has two branches, a starting point and a solution. (These branches are mentioned in each module as you do them).

The Effective UI Test Automation With Serenity BDD and Selenium teaches the fundamentals of UI Test Automation with Serenity BDD, and will give you a unique insight on how to use Serenity BDD the way it is intended. You'll discover:

  • How to write well-structured automated web tests with Serenity BDD, to maximise reuse and minimise maintenance costs
  • How to use Page Objects and Action Classes to make your test code more concise and more expressive, so you can write tests faster AND spend less time maintaining them later on;
  • How to write effective locators using XPath and CSS, including Serenity BDD's powerful dynamic locators
  • How to handle waits and asynchronous applications in Serenity BDD
  • How to use data-driven testing with Serenity to get higher coverage and better reporting
  • How to run tests in parallel and get feedback faster
  • How to run your Serenity BDD tests remotely on Selenium Grid and services such as SauceLabs and BrowserStack.
  • How to tailor your Serenity BDD reports, so they tell your stakeholders EXACTLY what they need to know
  • And much more

By the end of the course, you'll be able to build automated testing frameworks for your web applications quickly and effectivly from scratch, harnessing the full power of Serenity BDD.

TodoMVC Exercise

In this exercise, you will complete a series of simple tests against the TodoMVC application using core Serenity BDD features.

You can see a sample solution for this exercise here.

You can also see the sample report generated by Github actions here:

Get the code

Git:

git clone https://github.com/serenity-dojo/serenity-web-training/tree/todomvc-start
cd serenity-junit-starter
git checkout todomvc-start
git checkout -b my-todomvc-exercise

You will find the tests to implement in the WhenAddingTasks and WhenCompletingATask classes.

Exercise 1

Open the WhenAddingTasks and implement the addingASingleTask() method. Use a Serenity action class to implement the steps. Make sure the steps and assertions appear in the reports.

Exercise 2

Open the WhenAddingTasks and implement the addingMultipleTasks() method. You can reuse methods developed in the previous exercise.

Exercise 3

Open the WhenCompletingATask class and implement the activeTasksShouldNotShowCompletedTasks() method.

Exercise 4

Open the WhenCompletingATask class and implement the completedTasksShouldNotShowActiveTasks() method.

Exercise 5

Open the WhenDeletingATask class and implement the deletedItemsShouldDissapearFromTheList() method.

Exercise 6

Write a data-driven test to test the following scenarios:

  • When you add the items "Feed the cat" and "Walk the dog", and complete "Feed the cat", and then filter by "Completed", you should only see "Feed the cat"
  • When you add the items "Feed the cat" and "Walk the dog", and complete "Feed the cat", and then filter by "Active", you should only see "Walk the dog"
  • When you add the items "Feed the cat" and "Walk the dog", and complete "Feed the cat", and then filter by "All", you should all the items

See the sample reports here:

serenity-junit-tutorial's People

Contributors

andreiciorceanu avatar

Watchers

 avatar

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.