{"id":22848402,"url":"https://github.com/feedzai/first-system-test-workshop","last_synced_at":"2025-10-13T01:07:21.735Z","repository":{"id":45531775,"uuid":"212519946","full_name":"feedzai/first-system-test-workshop","owner":"feedzai","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-14T22:23:21.000Z","size":45,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-10-13T01:07:17.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feedzai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-03T07:24:30.000Z","updated_at":"2022-02-03T09:53:02.000Z","dependencies_parsed_at":"2024-12-13T04:12:17.546Z","dependency_job_id":"dafc706d-bf80-416d-bc70-dbe2ad21a7da","html_url":"https://github.com/feedzai/first-system-test-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/feedzai/first-system-test-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Ffirst-system-test-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Ffirst-system-test-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Ffirst-system-test-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Ffirst-system-test-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feedzai","download_url":"https://codeload.github.com/feedzai/first-system-test-workshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Ffirst-system-test-workshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013884,"owners_count":26085325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T04:12:07.141Z","updated_at":"2025-10-13T01:07:21.689Z","avatar_url":"https://github.com/feedzai.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workshop: Your First System Test - an introduction to Test Automation\n\n\u003cp style='text-align: justify;'\u003eThis workshop will cover some techniques and tools that allow us to apply test automation to perform regression testing  in a system. Nowadays, any software project needs to have automated tests that guarantee that the main functionality does not break during the development lifecycle. In this workshop we will focus on how to achieve this, by writing some automated tests for the APIs and GUI using the PetClinic application (https://github.com/spring-projects/spring-petclinic).\u003c/p\u003e\n\n#### Requirements:\n* Laptop\n* Java (https://www.java.com/en/download/)\n* Maven (https://maven.apache.org/install.html)\n* Docker (https://docs.docker.com/v17.12/install/ check the tab 'DockerCE' on the left bar of the site for different OS versions)\n* Chrome (https://www.google.com/chrome/)\n* IDE (recommended https://www.jetbrains.com/idea/download/ or https://www.eclipse.org/downloads/)\n\n## Getting Started\n### 1 - Installing Java and Maven\n\nMake sure you have Java 8 or later on your local development machine.\n```sh \njava -version\n```\nMake sure you have Maven 3.X on your local development machine.\n\n```sh \n mvn -v\n```\n\nMake sure you have Docker on your local development machine.\n\n```sh \n docker -v\n```  \n\n\n### 2 - Running the Project\n\nVerify that everything works by running:\n\n```sh\ngit clone https://github.com/feedzai/first-system-test-workshop\ncd first-system-test-workshop\nmvn clean install\n```\n\nEnsure that there were no failures. It means that you were able to launch test-containers and run a test against it.\n\nIf there are any questions or issues in the setup, feel free to email me: ricardo.lopes@feedzai.com\n\n\n---\n\n## Step by step\n\n### Your First System Test, an introduction to Test Automation\n### 1 - Bootstrap the application under test manually with Docker.\nRun the following command:\n```sh\ndocker run -dit -p 8080:8080 --name petclinic arey/springboot-petclinic\n```\n\n### 2 - Add a new RestAPI test to validate the 'Add Owner' functionality at `PetClinicApiTest` class\nLets start by doing it manually in Chrome:\n- Open the browser and navigate to the PetClinic homepage at http://localhost:8080\n- Open the Chrome Dev Tools in the Network tab\n- Fill the user form and submit. The body from the POST request to create the owner should be similar to:\n```json\n{\n  \"firstName\":\"John\",\n  \"lastName\":\"Dow\",\n  \"address\":\"Instituto Pedro Nunes\",\n  \"city\":\"Coimbra\",\n  \"telephone\":\"200000000\",\n  }\n```\nNow in the project open the `PetClinicApiTest` class and add a new test that adds a new owner to PetClinic:\n- Create a `post` and `addOwner` method in `PetclinicApi` class\n- Add a parameter body in `addOwner` with type `Object`\n- Create a new test calling that endpoint, pass a map in the body parameter with the structure from the json above\n\n### 3 - Create a Owner Object using a builder pattern\n\n### 4 - Add a set of Rest API tests to validate the telephone number implementation\n\n### 5 - Enable the `PetClinicApiTest` to run against Test Containers instead of a already running container\n\n### 6 - Execute the Selenium Test and ensure that it works\n\n### 7 - Add a new Selenium test that associates a new Pet with an existent user\n\n### 8 - Refactor the code in order to have methods to interact with common elements\n\n### 9 - Setup the Test-containers to run against Test Containers instead of a already running container\n\n### 10 - Ensure that all tests run with\n```sh\nmvn clean install\n```\n\n--- \n### Learn More\n* Test Containers (https://www.testcontainers.org/)\n* Rest Assured (http://rest-assured.io/)\n* Docker (https://github.com/wsargent/docker-cheat-sheet)\n* Selenide (https://selenide.org/)\n* Selenium (https://www.seleniumhq.org)\n* Test Levels and Approach to automation (https://martinfowler.com/articles/practical-test-pyramid.html)\n* Rules for writting automated tests (https://devops.com/10-rules-for-writing-automated-tests)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeedzai%2Ffirst-system-test-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeedzai%2Ffirst-system-test-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeedzai%2Ffirst-system-test-workshop/lists"}