Что делать если автоматизировать надо, а команды из 10 автоматизаторов нет и не будет. Докладчики расскажут о том как быстро и эффективно организовать автоматизацию на проекте с нуля и в одиночку. В ходе презентации вы узнаете как правильно начать строить фреймворк для автоматизации тестирования API и UI.
2. 2
Andrei Stasevich
Experience
• M.Sc. of engineering with more then
5 years experience
• Main IT specialization: Test Automation
• Technology: Java, GCP, Seleinum
• COMAQA.by community activist
Andrei Stasevich
EPAM Systems
Software Test Automation
Engineer
Aliaksandr Nestsiarovich
EPAM Systems
Jr. Software Test
Automation Engineer
Experience
• Main IT specialization: Test Automation
• Technology: Java, Selenium, Cucumber
4. 4
Test automation framework in general
Test Automation:
- More testing for less money;
- Helps to deploy/release
more frequently;
- Helps to improve quality;
27. 27
JDI
@JSite(domain = "https://mattrunks.com/en")
public class SeleniumSite extends WebSite {
@JPage(url = "/", title = "Mattrunks - Creative video tutorials about Motion
Design")
public static HomePage homePage;
@JPage(url = "/signup", title = "Create your account | Mattrunks")
public static RegistrationPage registrationPage;
}
public class RegistrationPage extends WebPage
{
@FindBy(css = "#UserSignupForm")
public RegistrationForm signInForm;
}
28. 28
JDI
@Test(dataProvider = “userInfo", dataProviderClass =
UserInfoProvider.class)
public void registrationTest(UserInfo userInfo) {
registrationPage.signInForm.fill(userInfo);
}
public class UserInfo {
public String name = "Ian";
public String email = "something@gmail.something";
public String prefLang = "English";
}
29. 29
JDI
public class RegistrationForm extends Form<UserInfo> {
@FindBy(css = "#UserUsername")
TextField name;
@FindBy(css = "#UserMail")
ITextField email;
@JFindBy(text = "Preferred language", group = "en")
@JFindBy(text = "Langage préférée", group = "fr")
Text preferedLangText;
@JTable(
root = @FindBy(css = ".stat-table"),
row = @FindBy(xpath = "./tbody/tr[%s]/td"),
column = @FindBy(xpath = "./tbody/tr/td[%s]"))
public ITable someTable;
}
33. 33
BDD
Features
Scenarios
Steps
Step Definition
Code
Scenario: Eat 5 out of 12
Given there are 12 cucumbers
When I eat 5 cucumbers
Then I should have 7 cucumbers
Scenario Outline: Eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
34. 34
Cucumber
@Given("^there are (d+) (.*)$")
public void veg1(int number, String veg) {
}
@Given("^there are (d+) (?:tomatoes|cucumbers)$")
public void veg2(int number) {
}
@Given("^there are (d+) (tomatoes|cucumbers)$")
public void veg3(int number, String vegType) {
}
http://blog.czeczotka.com/
there are 12 anything
there are 12 tomatoes
35. 35
Cucumber
public class Vegetable {
private String vegetable;
private int amount;
public String getVegetable () {
return vegetable;
}
public void setVegetable (String vegetable) {
this.vegetable = vegetable;
}
public int getAmount () {
return amount;
}
public void setAmount (int amount) {
this.amount = amount;
}
}
@Given("^there are some veggies$")
public void veg4(DataTable dataTable) {
}
@Given("^there are the following
veggies$")
public void veg5(List<Vegetable> list) {
}
there are the following veggies
| vegetable | amount |
| tomato | 4 |
| cucumber | 3 |
http://blog.czeczotka.com/