1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package dev.aherscu.qa.testing.example.scenarios.tutorial3;
18
19 import static dev.aherscu.qa.testing.utils.StreamMatchersExtensions.hasSpecificItems;
20
21 import org.testng.annotations.*;
22
23 import dev.aherscu.qa.jgiven.webdriver.*;
24 import dev.aherscu.qa.testing.example.*;
25 import dev.aherscu.qa.testing.example.model.tutorial.*;
26 import dev.aherscu.qa.testing.example.steps.tutorial.*;
27 import lombok.*;
28
29 public class Banking
30 extends
31 ApplicationPerMethodWebSessionTest<TestConfiguration, BankFixtures<?>, BankActions<?>, BankVerifications<?>> {
32
33 protected Banking() {
34 super(TestConfiguration.class);
35 }
36
37 @BeforeMethod
38 @SneakyThrows
39 @Override
40 public void beforeMethodOpenWebDriver() {
41 super.beforeMethodOpenWebDriver();
42 webDriver.get().asRemote().manage().window().maximize();
43 }
44
45 @Test(dataProvider = INTERNAL_DATA_PROVIDER)
46 public void shouldCreateCustomer(final Customer customer) {
47 given()
48 .a_bank(webDriver.get());
49
50 when()
51 .adding(customer);
52
53 then()
54 .the_customers(hasSpecificItems(customer));
55 }
56
57 @DataProvider
58 private Customer[] data() {
59 return new Customer[] {
60 Customer.builder()
61 .firstName("kuku")
62 .lastName("bar")
63 .postalCode("12345")
64 .build()
65 };
66 }
67 }