Skip to content

Instantly share code, notes, and snippets.

View eliasnogueira's full-sized avatar
🇧🇷

Elias Nogueira eliasnogueira

🇧🇷
View GitHub Profile
@eliasnogueira
eliasnogueira / SimulationController.java
Last active November 24, 2022 15:36
[JavaAdvent] Simulation controller example for the POST method
@PostMapping("/")
@ResponseStatus(HttpStatus.CREATED)
public ResponseEntity<Simulation> newSimulation(@Valid @RequestBody SimulationDto simulation) {
checkForRestriction(simulation.getCpf());
Simulation createdSimulation = repository.save(new ModelMapper().map(simulation, Simulation.class));
URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{cpf}").
buildAndExpand(createdSimulation.getCpf()).toUri();
return ResponseEntity.created(location).build();

Title

Build robust API tests with RestAssured

Description

This workshop will show you how to use a different approach from SpringTest or any other tool to build robust API tests in the integration later or intra-services.

Rest-Assured is a well-known Java DSL for testing REST services, giving software engineers a lot of freedom during the test automation process creation.

Title

Parallel frontend test execution using Selenium and Docker

Description

Nowadays, the main problem regarding front-end test execution is the time spent to cover the necessary scenarios to get the proper quality feedback. It's no wonder that we are focusing more on the earlier test stages like unit and integration. But frontend tests are also important, so how to make them faster?

I could reduce 2 days of manual tests to 35min sequential tests to 6min parallel tests for the same test suite! So you also can!

Title

Managing Testing Data

Description

Have you ever tried to troubleshoot an issue taking a looking at the log files? I bet you did! And it turns out the issue is related to data usage because, you know, users will use real data! Developers won't! A good thing about your recent troubleshooting is that you can understand the data. It's not a bunch of numbers or UUIDs in the name field. How about your development environment? Probably you use either hard-coded data or random strings. We must fix that!

@eliasnogueira
eliasnogueira / rest-assured-open-api.md
Last active September 11, 2022 20:29
Presentation about Rest-Assured and OpenAPI tools

Title

How to fast generate your API Test with OpenAPI Tools and Rest-Assured

Elevator pitch

API testing is, nowadays, a common activity for any team. Some still use record-and-play or tools that provide an IDE because it accelerates the test creation at the beginning, but in the mid to long term, it does not scale. Most of them have reasons: lack of programming skill, patterns, or simply time to do it.

In this presentation, you will learn how to speed up the API test automation using Java and Rest-Assured while the OpenAPI tools will create all the standard code to deal with the HTTP requests

@eliasnogueira
eliasnogueira / PageObjectWithAbstraction.java
Created August 22, 2022 07:31
Page Object using an abstract page that contains the Page Factory and AjaxElementLocatorFactory
public class PageObject extends AbstractPageObject {
// WebElements ignored
protected PageObject(WebDriver driver) {
super(driver);
}
// action steps ignored
}
@eliasnogueira
eliasnogueira / AbstractPageObject.java
Last active August 21, 2022 12:31
Example of an AbstractPageObject using the AjaxElementLocatorFactory
public abstract class AbstractPageObject {
private WebDriver driver;
protected AbstractPageObject(WebDriver driver) {
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 5), this);
}
}
public class PageObjectExample {
private WebDriver driver;
// WebElements ignored
public PageObjectExample(WebDriver driver) {
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 5), this);
}
}