new workflow
This commit is contained in:
1 parent
fe6cdf86a7
commit
7e93ab5040
3 files changed
+37
-8
No files matched your search
@@ -12,6 +12,9 @@ public class EsetHomePage extends Pages {
|
|||||||
@FindBy(id = "password")
|
@FindBy(id = "password")
|
||||||
public SelenideElement accountPasswordField;
|
public SelenideElement accountPasswordField;
|
||||||
|
|
||||||
|
@FindBy(id = "name")
|
||||||
|
public SelenideElement nameField;
|
||||||
|
|
||||||
// BUTTONS
|
// BUTTONS
|
||||||
@FindBy(id = "cc-accept")
|
@FindBy(id = "cc-accept")
|
||||||
public SelenideElement cookiesConsentAcceptButton;
|
public SelenideElement cookiesConsentAcceptButton;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package steps;
|
package steps;
|
||||||
|
|
||||||
import Utils.ColorFormatter;
|
import Utils.ColorFormatter;
|
||||||
import com.codeborne.selenide.Condition;
|
import com.codeborne.selenide.Selenide;
|
||||||
import com.codeborne.selenide.ex.ElementNotFound;
|
import com.codeborne.selenide.ex.ElementNotFound;
|
||||||
import io.cucumber.java.en.And;
|
import io.cucumber.java.en.And;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.datafaker.Faker;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
import org.passay.CharacterData;
|
import org.passay.CharacterData;
|
||||||
import org.passay.CharacterRule;
|
import org.passay.CharacterRule;
|
||||||
@@ -15,9 +16,10 @@ import pages.EsetHomePage;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import static com.codeborne.selenide.Selenide.$;
|
import static com.codeborne.selenide.Condition.*;
|
||||||
import static com.codeborne.selenide.Selenide.page;
|
import static com.codeborne.selenide.Selenide.*;
|
||||||
import static frameworkContext.ContextFactory.getContext;
|
import static frameworkContext.ContextFactory.getContext;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -27,17 +29,23 @@ public class EsetHomeSteps extends Steps {
|
|||||||
|
|
||||||
@And("EsetHomePage: Click button {string}")
|
@And("EsetHomePage: Click button {string}")
|
||||||
public void esethomepageClickButton(String buttonName) {
|
public void esethomepageClickButton(String buttonName) {
|
||||||
$(By.xpath("//*[text()='%s' and not(self::b)]"
|
$$(By.xpath("//*[text()='%s' and not(self::b)]"
|
||||||
.formatted(buttonName)))
|
.formatted(buttonName)))
|
||||||
|
.filter(visible)
|
||||||
|
.filter(enabled)
|
||||||
|
.first()
|
||||||
|
.shouldBe(interactable)
|
||||||
.scrollIntoCenter()
|
.scrollIntoCenter()
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
Selenide.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@And("EsetHomePage: Accept cookies")
|
@And("EsetHomePage: Accept cookies")
|
||||||
public void esethomepageAcceptCookies() {
|
public void esethomepageAcceptCookies() {
|
||||||
try {
|
try {
|
||||||
webPage.cookiesConsentAcceptButton
|
webPage.cookiesConsentAcceptButton
|
||||||
.shouldBe(Condition.visible, Duration.ofSeconds(5))
|
.shouldBe(visible, Duration.ofSeconds(5))
|
||||||
.scrollIntoCenter()
|
.scrollIntoCenter()
|
||||||
.click();
|
.click();
|
||||||
} catch (ElementNotFound e) {
|
} catch (ElementNotFound e) {
|
||||||
@@ -82,6 +90,15 @@ public class EsetHomeSteps extends Steps {
|
|||||||
getContext().getScenario().log(keyText);
|
getContext().getScenario().log(keyText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@And("EsetHomePage: Enter generated name")
|
||||||
|
public void esethomepageEnterGeneratedName() {
|
||||||
|
String name = new Faker(new Locale("pl")).name().fullName();
|
||||||
|
|
||||||
|
webPage.nameField.scrollIntoCenter().setValue(name);
|
||||||
|
|
||||||
|
log.info("Name entered: {}", ColorFormatter.RED.toConsole(name));
|
||||||
|
}
|
||||||
|
|
||||||
public static String generatePassword(int length) {
|
public static String generatePassword(int length) {
|
||||||
PasswordGenerator generator = new PasswordGenerator();
|
PasswordGenerator generator = new PasswordGenerator();
|
||||||
List<CharacterRule> rules = Arrays.asList(
|
List<CharacterRule> rules = Arrays.asList(
|
||||||
|
|||||||
@@ -11,11 +11,20 @@ Feature: Download ESET Smart Security license key
|
|||||||
And EsetHomePage: Enter generated password
|
And EsetHomePage: Enter generated password
|
||||||
And EsetHomePage: Click button "Utwórz konto lub zaloguj się"
|
And EsetHomePage: Click button "Utwórz konto lub zaloguj się"
|
||||||
And TempMailAPI: Confirm Home Eset registration
|
And TempMailAPI: Confirm Home Eset registration
|
||||||
And EsetHomePage: Click button "Pierwsze kroki"
|
And EsetHomePage: Click button "Pomiń wprowadzenie"
|
||||||
And EsetHomePage: Click button "Wypróbuj ESET za darmo"
|
And EsetHomePage: Click button "Rozpocznij bezpłatny 30-dniowy okres próbny"
|
||||||
And EsetHomePage: Click button "Kontynuuj"
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
And EsetHomePage: Click button "Chroń swój dom"
|
And EsetHomePage: Click button "Chroń swój dom"
|
||||||
And EsetHomePage: Click button "Kontynuuj"
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
And EsetHomePage: Click button "Wyświetl szczegóły dotyczące wersji próbnej"
|
|
||||||
And EsetHomePage: Click button "Kontynuuj"
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
|
And EsetHomePage: Enter generated name
|
||||||
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
|
And EsetHomePage: Click button "Tylko ja"
|
||||||
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
|
And EsetHomePage: Click button "Chroń to urządzenie"
|
||||||
|
And EsetHomePage: Click button "Kontynuuj"
|
||||||
|
And EsetHomePage: Click button "Zakończ"
|
||||||
|
And EsetHomePage: Click button "Subskrypcje"
|
||||||
|
And EsetHomePage: Click button "Wyświetl subskrypcję"
|
||||||
And EsetHomePage: Read ESET Smart Security activation code
|
And EsetHomePage: Read ESET Smart Security activation code
|
||||||
Reference in new issue
Block a user