diff --git a/.github/workflows/test-execution.yml b/.github/workflows/test-execution.yml new file mode 100644 index 00000000..eeaf8471 --- /dev/null +++ b/.github/workflows/test-execution.yml @@ -0,0 +1,46 @@ +name: Test execution + +on: + push: + paths: + - mrchecker-playwright-framework/** + +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/playwright/java:v1.44.0-jammy + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK and Maven + uses: actions/setup-java@v2 + with: + java-version: '21' + distribution: 'zulu' + maven-version: '3.8.1' + + - name: Install git + run: apt-get -y update && apt-get install -y git-lfs + + - name: Install tests + run: mvn install -DskipTests --no-transfer-progress + working-directory: ./mrchecker-playwright-framework + + - name: Run tests + run: mvn test -Dheadless=true + working-directory: ./mrchecker-playwright-framework + + - name: Generate Allure report + run: mvn allure:report + working-directory: ./mrchecker-playwright-framework + + - name: Publish test report + uses: peaceiris/actions-gh-pages@v4 + if: always() + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: allure-report + publish_dir: ./mrchecker-playwright-framework/target/allure-report \ No newline at end of file diff --git a/mrchecker-playwright-framework-empty/playwrightRecoding.txt b/mrchecker-playwright-framework-empty/playwrightRecoding.txt new file mode 100644 index 00000000..cc991d2a --- /dev/null +++ b/mrchecker-playwright-framework-empty/playwrightRecoding.txt @@ -0,0 +1,39 @@ + page.navigate("https://demoqa.com/login"); + page.locator("span").filter(new Locator.FilterOptions().setHasText("Forms")).locator("div").first().click(); + page.getByRole(AriaRole.LISTITEM).click(); + page.getByPlaceholder("First Name").click(); + page.getByPlaceholder("First Name").fill("Name"); + page.getByPlaceholder("Last Name").click(); + page.getByPlaceholder("Last Name").fill("LastName"); + page.getByPlaceholder("name@example.com").click(); + page.getByPlaceholder("name@example.com").fill("my@google.pl"); + page.getByText("Male", new Page.GetByTextOptions().setExact(true)).click(); + page.getByText("Female").click(); + page.getByText("Other").click(); + page.getByPlaceholder("Mobile Number").click(); + page.getByPlaceholder("Mobile Number").fill("1234567"); + page.locator("#dateOfBirthInput").click(); + page.getByLabel("Choose Sunday, April 14th,").click(); + page.locator(".subjects-auto-complete__value-container").click(); + page.locator("#subjectsInput").fill("Math"); + page.locator("div").filter(new Locator.FilterOptions().setHasText(Pattern.compile("^Math$"))).nth(1).click(); + page.locator(".subjects-auto-complete__value-container").click(); + page.locator("#subjectsInput").fill("a"); + Page page1 = page.waitForPopup(() -> { + page.frameLocator("iframe[name=\"google_ads_iframe_\\/21849154601\\,22343295815\\/Ad\\.Plus-Anchor_0\"]").locator("html").click(); + }); + page.locator(".subjects-auto-complete__value-container").click(); + page.locator("#subjectsInput").fill("a"); + page.getByText("Maths", new Page.GetByTextOptions().setExact(true)).click(); + page.getByText("Sports").click(); + page.getByText("Reading").click(); + page.getByText("Music").click(); + page.getByPlaceholder("Current Address").click(); + page.getByPlaceholder("Current Address").fill("ala ma kota"); + page.locator("#state svg").click(); + page.getByText("Uttar Pradesh", new Page.GetByTextOptions().setExact(true)).click(); + page.locator("#city svg").click(); + page.getByText("Agra", new Page.GetByTextOptions().setExact(true)).click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Submit")).click(); + page.getByPlaceholder("Mobile Number").click(); + page.getByPlaceholder("Mobile Number").fill("1234567890"); \ No newline at end of file diff --git a/mrchecker-playwright-framework/pom.xml b/mrchecker-playwright-framework/pom.xml index f0874890..3ac4ed7c 100644 --- a/mrchecker-playwright-framework/pom.xml +++ b/mrchecker-playwright-framework/pom.xml @@ -34,7 +34,7 @@ 3 ENV1 - 1.42.0 + 1.44.0 5.10.1 diff --git a/mrchecker-playwright-framework/src/main/java/com/capgemini/framework/actions/ActionGui.java b/mrchecker-playwright-framework/src/main/java/com/capgemini/framework/actions/ActionGui.java index 798ad31b..9395dc75 100644 --- a/mrchecker-playwright-framework/src/main/java/com/capgemini/framework/actions/ActionGui.java +++ b/mrchecker-playwright-framework/src/main/java/com/capgemini/framework/actions/ActionGui.java @@ -2,18 +2,30 @@ import com.capgemini.framework.logger.AllureStepLogger; import com.capgemini.framework.logger.Logger; +import com.microsoft.playwright.Dialog; +import com.microsoft.playwright.ElementHandle; import com.microsoft.playwright.Locator; import com.microsoft.playwright.Page; import com.microsoft.playwright.options.LoadState; +import com.microsoft.playwright.options.WaitForSelectorState; import io.qameta.allure.Step; +import org.assertj.core.api.Assertions; +import org.assertj.core.api.Fail; +import java.util.List; +import java.util.function.Consumer; + +import static com.capgemini.framework.playwright.PlaywrightFactory.getBrowserContext; import static com.capgemini.framework.playwright.PlaywrightFactory.getPage; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.junit.jupiter.api.Assertions.fail; public final class ActionGui { @Step("Fill text field \"{fieldName}\" with \"{inputValue}\"") public static void fillTextBox(String fieldName, String inputValue, Locator locator) { locator.click(); locator.fill(inputValue); + AllureStepLogger.info(inputValue + " in textbox " + fieldName + " is typed"); } public static void fillTextBox(String fieldName, String inputValue, String selector) { @@ -23,6 +35,7 @@ public static void fillTextBox(String fieldName, String inputValue, String selec @Step("Set radiobutton \"{fieldName}\"") public static void setRadioButton(String fieldName, Locator locator) { locator.click(); + AllureStepLogger.info(fieldName + " is selected"); } public static void setRadioButton(String fieldName, String selector) { @@ -31,29 +44,111 @@ public static void setRadioButton(String fieldName, String selector) { @Step("Click \"{fieldName}\"") public static void click(String fieldName, Locator locator) { - locator.click(); + if(!locator.isVisible()){ + Fail.fail(fieldName + " is not visible and cannot be clicked."); + } + if(!locator.isEnabled()){ + Fail.fail(fieldName + " is not enabled and cannot be clicked."); + } + try { + locator.click(new Locator.ClickOptions().setTimeout(20000)); + } catch (Exception e) { + Logger.logError("Error while clicking on " + fieldName + ": " + e.getMessage()); + Fail.fail(fieldName + " cannot be clicked."); + } + AllureStepLogger.info(fieldName + " is clicked"); + } + + public static void click(String fieldName, Locator locator, double timeout) { + if(!locator.isVisible()){ + Fail.fail(fieldName + " is not visible and cannot be clicked."); + } + if(!locator.isEnabled()){ + Fail.fail(fieldName + " is not enabled and cannot be clicked."); + } + try { + locator.click(new Locator.ClickOptions().setTimeout(timeout)); + } catch (Exception e) { + Logger.logError("Error while clicking on " + fieldName + ": " + e.getMessage()); + Fail.fail(fieldName + " cannot be clicked. " + e.getMessage()); + } + AllureStepLogger.info(fieldName + " is clicked"); + } + + public static void click(String fieldName, Locator locator, boolean waitForPageLoadingToFinish) { + click(fieldName, locator); + if (waitForPageLoadingToFinish) { + ActionGui.waitForPageLoadingFinish(); + } } public static void pressEnter(Locator locator) { locator.press("Enter"); } - + @Step("Select value \"{value}\" in Dropdown \"{fieldName}\"") + public static void selectDropdownValue(String value, String fieldName, Locator locator) { + locator.click(); + locator.selectOption(value); + AllureStepLogger.info(value + " in Dropdown " + fieldName + " is selected"); + } @Step("Verify {fieldName} is visible") public static void verifyElementVisible(String fieldName, Locator locator) { - locator.isVisible(); + Assertions.assertThat(locator.isVisible()).as(fieldName + " visible").withFailMessage(fieldName + " is not visible").isTrue(); } public static void verifyElementVisible(String fieldName, String selector) { verifyElementVisible(fieldName, getPage().locator(selector)); } - + @Step("Wait for {fieldName} to disappear") + public static void waitForElementToDisappear(String fieldName, Locator locator) { + locator.waitFor(new Locator.WaitForOptions().setState(WaitForSelectorState.HIDDEN)); + } + @Step("Open page {url}") public static void navigate(String url, int pageLoadingTimeout) { getPage().navigate(url, new Page.NavigateOptions().setTimeout(pageLoadingTimeout)); getPage().onLoad(p -> AllureStepLogger.info("Page loaded!")); } - + @Step("Check {fieldName} checkbox") + public static void checkCheckBox(String fieldName, Locator locator) { + locator.check(); + AllureStepLogger.info(fieldName + " checkbox is checked"); + } + public static void clickIfVisible(String fieldName, Locator locator, boolean b) { + if (locator.isVisible()) { + click(fieldName, locator, b); + } + } + + @Step("Check Banner has text {bannerText}") + public static void checkBannerText(String bannerText, Locator locator) { + AllureStepLogger.info("Banner text is: " + locator.textContent()); + assertThat(locator.textContent()).withFailMessage("Text on banner is " + locator.textContent() + " but it should be " + bannerText) + .contains(bannerText); + } + + @Step("Get Banner text") + public static String getBannerText() { + Locator banner; + try{ banner = getPage().locator("div[class*='PageControllerStatusLine']");} + catch(Exception e){ + return ""; + }; + AllureStepLogger.info("Banner text is: " + banner.textContent()); + return banner.textContent(); + } + @Step("Check that {element} has text {expectedText}") + public static void verifyElementHasText(String element, String expectedText, Locator locator) { + AllureStepLogger.info(element + " text is: " + locator.textContent()); + assertThat(locator.textContent()).withFailMessage("Text is " + locator.textContent() + " but it should be " + expectedText) + .contains(expectedText); + } + + public static boolean isElementPresent(Locator locator) { + return locator.isVisible(); + } + public void waitForPageToLoad() { getPage().waitForLoadState(LoadState.NETWORKIDLE); } @@ -72,4 +167,68 @@ public static void waitMilliseconds(Integer milliseconds) { } } + @Step("Wait for page loading to finish") + public static void waitForPageLoadingFinish(){ + String loadingAnimation = "div[id^='RadAjaxLoadingPanel']"; + waitForElementToDisappear("Loading animation", getPage().locator(loadingAnimation).first()); + //second version: getPage().waitForSelector(loadingAnimation).waitForElementState(ElementState.HIDDEN); + } + + + @Step("Check on column name {columnName} for first row text {searchText}") + public static boolean isTextPresentInFirstRow(String columnName, String searchText) { + int columnIndex = getColumnIndex(columnName); + List rows = getPage().querySelectorAll("table tr"); + if (!rows.isEmpty()) { + ElementHandle firstRow = rows.get(0); + String cellText = firstRow.querySelectorAll("td span").get(columnIndex).textContent(); + return cellText.contains(searchText); + } else { + return false; + } + } + + @Step("Find index for column name {columnName}") + private static int getColumnIndex(String columnName) { + List headers = getPage().querySelectorAll("table th a span"); + for (int i = 0; i < headers.size(); i++) { + String headerText = headers.get(i).textContent(); + if (headerText.equals(columnName)) { + return i; + } + } + return -1; + } + + @Step("Create a dialog handler that will check message text and press OK/Cancel") + public static void checkPopupMessageTextAndPressOKCancel(boolean pressOK, String messageText) { + Consumer handler = dialog -> { + Logger.logInfo("Popup message: " + dialog.message()); + Logger.logInfo("Popup message will be OK: " + pressOK); + // Which option you want to click + if (dialog.message().contains(messageText)) { + if (pressOK) { + // Click on button "OK" + dialog.accept(); + Logger.logInfo("Clicked on 'OK'"); + } else { + // Click on button "Cancel" + dialog.dismiss(); + Logger.logInfo("Clicked on 'Cancel'"); + } + }else { + fail("Popup message is not as expected " + dialog.message() + " but it should be " + messageText); + } + }; + getPage().onDialog(handler); + getPage().offDialog(handler); + } + @Step("Check that {fieldName} has text {expectedText}") + public static void checkText(String fieldName, String expectedText, Locator locator) { + assertThat(locator.textContent()) + .as(fieldName) + .isEqualTo(expectedText); + } + + } diff --git a/mrchecker-playwright-framework/src/main/java/com/capgemini/pages/demoqaforms/helper/GremlinsHelper.java b/mrchecker-playwright-framework/src/main/java/com/capgemini/pages/demoqaforms/helper/GremlinsHelper.java new file mode 100644 index 00000000..8a0fa9ea --- /dev/null +++ b/mrchecker-playwright-framework/src/main/java/com/capgemini/pages/demoqaforms/helper/GremlinsHelper.java @@ -0,0 +1,162 @@ +package com.capgemini.pages.demoqaforms.helper; + +import com.microsoft.playwright.Page; +import io.qameta.allure.Allure; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * @author Michal Carlo + * @since 2024-03-19 + * Gremlins is a monkey testing library that performs random actions on the page. + */ + +public final class GremlinsHelper { + public static final String GREMLIN_JS_EXPRESSION = "gremlin JS expression"; + static final Path PATH_TO_GREMLINS = Paths.get("target/js/node_modules/gremlins.min.js"); + private static final Logger LOGGER = LoggerFactory.getLogger(GremlinsHelper.class.getCanonicalName()); + + public GremlinsHelper() { + } + + /** + * Get JS script for Gremlins. + * + * @throws IOException Gremlins script not found + */ + public static void copyGremlinsJSFromResources() throws IOException { + Files.createDirectories(Paths.get("target/js/node_modules")); + try (InputStream stream = Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResourceAsStream("js/gremlins.min.js"))) { + Files.copy(stream, PATH_TO_GREMLINS); + } + } + + /** + * Install Gremlins script in the environment. + * + * @param page Playwright page + * @throws IOException Gremlins script not found + */ + public static void setupGremlinsScript( + final Page page) throws IOException { + if (!Files.exists(PATH_TO_GREMLINS)) { + copyGremlinsJSFromResources(); + } + page.evaluate( Files.readString( Path.of(System.getProperty("user.dir") + "/" + PATH_TO_GREMLINS), Charset.defaultCharset())); + } + + /** + * unleash Gremlin horde with default settings. + * + * @param page Playwright page + */ + public static void startGremlinHorde( + final Page page) { + page.evaluate("() => gremlins.createHorde().unleash()"); + } + + /** + * unleash Gremlin horde with repeatable behaviour due to overwritten seed value. + * + * @param page Playwright page + * @param randomizerValue seed value to influence gremlin behaviour + */ + public static void startGremlinHordeWithRepeatableBehaviour( + final Page page, + final int randomizerValue) { + String expression = "const horde = gremlins.createHorde({randomizer: new gremlins.Chance(%%%)})\n" + .replace("%%%", String.valueOf(randomizerValue)) + + "horde.unleash()"; + LOGGER.debug("random gremlin horde expression: {}", expression); + Allure.addAttachment(GREMLIN_JS_EXPRESSION, expression); + page.evaluate(expression); + } + + /** + * unleash Gremlin horde with a particular Gremlin number. + * + * @param page Playwright page + * @param gremlinCount number of Gremlins, tne higher, the longer the attack lasts. + */ + public static void startGremlinHordeWithGremlinCount( + final Page page, + final int gremlinCount) { + String expression = "const horde = gremlins.createHorde({ strategies: [gremlins.strategies.allTogether({ nb: %%%})],}) \n" + .replace("%%%", String.valueOf(gremlinCount)) + + "horde.unleash()"; + LOGGER.debug("gremlin count expression: {}", expression); + Allure.addAttachment(GREMLIN_JS_EXPRESSION, expression); + page.evaluate(expression); + } + + /** + * unleash Gremlin horde with particular Gremlin species. + * + * @param page Playwright page + * @param gremlinSpeciesList list of gremlin species to use, allowed values "clicker", "toucher", "formFiller", "scroller", "typer" + */ + public static void startGremlinHordeWithGremlinTypes( + final Page page, + final List gremlinSpeciesList) { + String speciesList = parseGremlinsSpeciesList(gremlinSpeciesList); + String expression = "gremlins.createHorde({\n" + + " species: %%%\n ".replace(" %%%", speciesList) + + " })\n" + + " .unleash();"; + LOGGER.debug("gremlin type expression: {}", expression); + Allure.addAttachment(GREMLIN_JS_EXPRESSION, expression); + page.evaluate(expression); + } + + /** + * unleash Gremlin horde with selectable count and species. + * + * @param page Playwright page + * @param gremlinCount number of Gremlins, tne higher, the longer the attack lasts + * @param delay delay between attacks in ms + * @param gremlinSpeciesList list of gremlin species to use, allowed values "clicker", "toucher", "formFiller", "scroller", "typer" + */ + public static void startGremlinHordeFullyCustomisable( + final Page page, + final int gremlinCount, + final int delay, + final List gremlinSpeciesList) { + String speciesList = parseGremlinsSpeciesList(gremlinSpeciesList); + String expression = "gremlins.createHorde({\n" + + " species: %%%,\n".replace(" %%%", speciesList) + + " strategies:[gremlins.strategies.allTogether({ nb: %%%})],\n".replace("%%%", String.valueOf(gremlinCount)) + + " delay: %%%,\n".replace("%%%", String.valueOf(delay)) + + " })\n" + + " .unleash();"; + LOGGER.debug("gremlin custom horde expression: {}", expression); + Allure.addAttachment(GREMLIN_JS_EXPRESSION, expression); + page.evaluate(expression); + } + + private static String parseGremlinsSpeciesList( + final List gremlinSpeciesList) { + List parsedGremlinsList = new ArrayList<>(); + for (String gremlinSpecies : gremlinSpeciesList) { + if (isSpeciesAllowed(gremlinSpecies)) { + parsedGremlinsList.add("gremlins.species." + gremlinSpecies + "()"); + } + } + return parsedGremlinsList.toString(); + } + + private static boolean isSpeciesAllowed(final String gremlinSpecies) { + List allowedSpecies = Arrays.asList("clicker", "toucher", "formFiller", "scroller", "typer"); + return allowedSpecies.contains(gremlinSpecies); + } +} diff --git a/mrchecker-playwright-framework/src/test/java/com/capgemini/monkeyTest/MonkeyTests.java b/mrchecker-playwright-framework/src/test/java/com/capgemini/monkeyTest/MonkeyTests.java new file mode 100644 index 00000000..bfd6e2f0 --- /dev/null +++ b/mrchecker-playwright-framework/src/test/java/com/capgemini/monkeyTest/MonkeyTests.java @@ -0,0 +1,61 @@ +package com.capgemini.monkeyTest; + +import com.capgemini.framework.enums.PrjEpics; +import com.capgemini.framework.logger.AllureStepLogger; +import com.capgemini.framework.logger.Logger; +import com.capgemini.framework.playwright.BaseTest; +import com.capgemini.framework.tags.Status; +import com.capgemini.pages.demoqaforms.DemoQALoginPage; +import com.capgemini.pages.demoqaforms.helper.GremlinsHelper; +import io.qameta.allure.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static com.capgemini.framework.playwright.PlaywrightFactory.getPage; + +/** + * @author Michal Carlo + * @author Malgorzata Dzienia + * @since 2024-03-19 + * Gremlins is a monkey testing library that performs random actions on the page. + */ + +@Epic(PrjEpics.DEMO_QA) +@Feature("GUI Monkey Tests") +public class MonkeyTests extends BaseTest { + + private final DemoQALoginPage demoQALoginPage = new DemoQALoginPage(); + + + @Step("[SETUP]") + @BeforeEach + public void beforeEach() { + AllureStepLogger.step("This is example step inside setUpTest()"); + demoQALoginPage.startPage(); + getPage().onConsoleMessage((msg) -> { + Logger.logInfo(msg.text()); + }); + + } + @TmsLink("Test Management System ID") + @Test + @Tag(Status.REVIEW) + void demoQALoginPageMonkeyTest_fill_form_test() throws IOException { + GremlinsHelper gremlinsHelper = new GremlinsHelper(); + GremlinsHelper.setupGremlinsScript(getPage()); + GremlinsHelper.startGremlinHordeWithGremlinTypes(getPage(), List.of("clicker", "formFiller", "typer")); + } + + @Test + @Tag(Status.REVIEW) + void demoQALoginPageMonkeyTest_test() throws IOException { + GremlinsHelper gremlinsHelper = new GremlinsHelper(); + GremlinsHelper.setupGremlinsScript(getPage()); + GremlinsHelper.startGremlinHorde(getPage()); + } +} + diff --git a/mrchecker-playwright-framework/src/test/java/com/capgemini/testTemplateGeneratorFromXrayCsv/TestTemplateGenerated.java b/mrchecker-playwright-framework/src/test/java/com/capgemini/testTemplateGeneratorFromXrayCsv/TestTemplateGenerated.java deleted file mode 100644 index afb35686..00000000 --- a/mrchecker-playwright-framework/src/test/java/com/capgemini/testTemplateGeneratorFromXrayCsv/TestTemplateGenerated.java +++ /dev/null @@ -1,254 +0,0 @@ -//imports -import com.capgemini.framework.logger.AllureStepLogger; -import com.capgemini.framework.playwright.BaseTest; -import com.capgemini.framework.playwright.PlaywrightFactory; -import io.qameta.allure.*; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Tag; -import static org.junit.Assert.fail; -import com.capgemini.framework.tags.Status; -public class TestTemplateGenerated extends BaseTest { - - -@TmsLink("TmsLink-TODO") -@Epic("") // TODO add epic -@Story("") // TODO add story -@Description("") // TODO add description -@Test -@Tag(Status.IN_PROGRESS) -public void TestTemplateGenerated_test(){ - - - //calls to methods: - - goInStepperToStepStep1(); - clickOnRadioButtonJaDerUmfangWirdMitFolgenderIdFieldNachgewiesen(); - fillTextboxIdFieldWithABlank(); - fillTextboxIdFieldWith20AlphanumericCharacters(); - fillTextboxIdFieldWithMoreThan20AlphanumericCharacters(); - clickOnRadioButtonJaDerAlteBerichtMitDerFolgendenIdFieldWirdErsetzt(); - fill2ndTextboxIdFieldWithABlank(); - fill2ndTextboxIdFieldWith20AlphanumericCharacters(); - fill2ndTextboxIdFieldWithMoreThan20AlphanumericCharacters(); - clickOnRadioButtonNeinDasSchmetterlingsblattIstInDemNeuenBerichtEnthalten(); - clickOnRadioButtonJaDerNeueNachweisIstImNeuenBerichtEnthalten(); - clickOnRadioButtonNeinDerBerichtIstWeiterhinGueltig(); - clickOnRadioButtonJaDerAlteBerichtMitDerFolgendenIdFieldWirdErsetzt1() /* TODO remove or change the method's name */ ; - clickOnRadioButtonNeinDerUmfangIstNichtSelbstzertifizierungsrelevant(); - clickOnRadioButtonJaDerUmfangWirdImSelbstzertifizierungsberichtMitFolgenderIdFieldNachgewiesen(); - fillTextboxIdFieldWithSomeText(); - clickOnRadioButtonNeinDerBerichtIstWeiterhinGueltig1() /* TODO remove or change the method's name */ ; - methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk(); - methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk1() /* TODO remove or change the method's name */ ; - methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk2() /* TODO remove or change the method's name */ ; - methodFromHellSgTlnrDdfgoejjQuestionMarkQuestionMarkQuestionMarkHhhhywgZghhkkkk(); - fail( "This is test case template generated from Xray exported CSV. Please fill it with test implementation."); -} - - - //definitions of methods: - - @Step("Go in stepper to step \"STEP1\"") - private void goInStepperToStepStep1() { - AllureStepLogger.info("In part \"Selbstzertifizierungsbericht\" the following texts and options are shown:\n"+ - "* Ist die Änderung selbstzertifizierungsrelevant \n"+ - "und wird in einem Selbstzertifizierungsbericht durch den Fachbereich nachgewiesen?\n"+ - " * Nein - der Umfang ist nicht selbstzertifizierungsrelevant .\n"+ - " * Ja - der Umfang wird mit folgender ID-Field nachgewiesen:\n"+ - "By default none of the radio buttons is set.\n"+ - "The texts are correct."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Ja - der Umfang wird mit folgender ID-Field nachgewiesen:\"") - private void clickOnRadioButtonJaDerUmfangWirdMitFolgenderIdFieldNachgewiesen() { - AllureStepLogger.info("The element can be selected.\n"+ - "Only the radio button for this element is set.\n"+ - "Following elements expand:\n"+ - "* \"ID-Field\"\n"+ - "* Erfordert die Änderung eine Anpassung des Selbstzertifizierungsberichts?\n"+ - "* Nein - der Bericht ist weiterhin gültig.\n"+ - "* Ja - der alte Bericht mit der folgenden ID-Field wird ersetzt:\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook.\n"+ - "By default none of the radio buttons is set.\n"+ - "The texts are correct."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill textbox \"ID-Field\" with a blank.") - private void fillTextboxIdFieldWithABlank() { - AllureStepLogger.info("The blank can be entered.\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill textbox \"ID-Field\" with 20 alphanumeric characters.") - private void fillTextboxIdFieldWith20AlphanumericCharacters() { - AllureStepLogger.info("20 characters can be entered.\n"+ - "Field \"ID-Field\" shows a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill textbox \"ID-Field\" with >20 alphanumeric characters.") - private void fillTextboxIdFieldWithMoreThan20AlphanumericCharacters() { - AllureStepLogger.info("More than 20 characters cannot be entered.\n"+ - "Field \"ID-Field\" shows a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Ja - der alte Bericht mit der folgenden ID-Field wird ersetzt:\"") - private void clickOnRadioButtonJaDerAlteBerichtMitDerFolgendenIdFieldWirdErsetzt() { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set.\n"+ - "Following elements expand:\n"+ - "* \"ID-Field\"\n"+ - "* Erfordert die Änderung einen neuen Nachweis?\n"+ - "* Nein - das Schmetterlingsblatt ist in dem neuen Bericht enthalten.\n"+ - "* Ja - der neue Nachweis ist im neuen Bericht enthalten.\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook.\n"+ - "By default none of the radio buttons is set.\n"+ - "The texts are correct."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill 2nd textbox \"ID-Field\" with a blank.") - private void fill2ndTextboxIdFieldWithABlank() { - AllureStepLogger.info("The blank can be entered.\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill 2nd textbox \"ID-Field\" with 20 alphanumeric characters.") - private void fill2ndTextboxIdFieldWith20AlphanumericCharacters() { - AllureStepLogger.info("20 characters can be entered.\n"+ - "Field \"ID-Field\" shows a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill 2nd textbox \"ID-Field\" with >20 alphanumeric characters.") - private void fill2ndTextboxIdFieldWithMoreThan20AlphanumericCharacters() { - AllureStepLogger.info("More than 20 characters cannot be entered.\n"+ - "Field \"ID-Field\" shows a green frame with a green hook."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Nein - das Schmetterlingsblatt ist in dem neuen Bericht enthalten.\"") - private void clickOnRadioButtonNeinDasSchmetterlingsblattIstInDemNeuenBerichtEnthalten() { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Ja - der neue Nachweis ist im neuen Bericht enthalten.\"") - private void clickOnRadioButtonJaDerNeueNachweisIstImNeuenBerichtEnthalten() { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Nein - der Bericht ist weiterhin gültig.\"") - private void clickOnRadioButtonNeinDerBerichtIstWeiterhinGueltig() { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set.\n"+ - "The 2nd field \"ID-Field\" and the text and elements below disappear."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Ja - der alte Bericht mit der folgenden ID-Field wird ersetzt:\"") - private void clickOnRadioButtonJaDerAlteBerichtMitDerFolgendenIdFieldWirdErsetzt1() /* TODO remove or change the method's name */ { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set.\n"+ - "Following elements expand:\n"+ - "* \"ID-Field\"\n"+ - "* Erfordert die Änderung einen neuen Nachweis?\n"+ - "* Nein - das Schmetterlingsblatt ist in dem neuen Bericht enthalten.\n"+ - "* Ja - der neue Nachweis ist im neuen Bericht enthalten.\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook.\n"+ - "By default none of the radio buttons is set."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Nein - der Umfang ist nicht selbstzertifizierungsrelevant.\"") - private void clickOnRadioButtonNeinDerUmfangIstNichtSelbstzertifizierungsrelevant() { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set.\n"+ - "The field \"ID-Field\" and the text and elements below disappear."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Ja - der Umfang wird im Selbstzertifizierungsbericht mit folgender ID-Field nachgewiesen:\"") - private void clickOnRadioButtonJaDerUmfangWirdImSelbstzertifizierungsberichtMitFolgenderIdFieldNachgewiesen() { - AllureStepLogger.info("The element can be selected.\n"+ - "Only the radio button for this element is set.\n"+ - "Following elements expand:\n"+ - "* \"ID-Field\"\n"+ - "* Erfordert die Änderung eine Anpassung des Selbstzertifizierungsberichts?\n"+ - "* Nein - der Bericht ist weiterhin gültig.\n"+ - "* Ja - der alte Bericht mit der folgenden ID-Field wird ersetzt:\n"+ - "Field \"ID-Field\" does NOT show a green frame with a green hook.\n"+ - "By default none of the radio buttons is set.\n"+ - "The texts are correct."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Fill textbox \"ID-Field\" with some text") - private void fillTextboxIdFieldWithSomeText() { - AllureStepLogger.info("The text can be entered.\n"+ - "Field \"ID-Field\" shows a green frame with a green hook"); - AllureStepLogger.makeScreenshot(); - } - - - @Step("Click on radio button \"Nein - der Bericht ist weiterhin gültig.\"") - private void clickOnRadioButtonNeinDerBerichtIstWeiterhinGueltig1() /* TODO remove or change the method's name */ { - AllureStepLogger.info("The element can be selected.\n"+ - "The radio button for this element is set."); - AllureStepLogger.makeScreenshot(); - } - - - @Step("METHOD from *hell* SG-TLNR DDFGÖJJ HHHHywG \"ZGhh\" kkkk") - private void methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk() { - AllureStepLogger.info("METHOD from *hell* SG-TLNR\n"+ - " DDFGÖJJ HHHHywG \"ZGhh\" kkkk"); - AllureStepLogger.makeScreenshot(); - } - - - @Step("METHOD from *hell* SG-TLNR DDFGÖJJ HHHHywG \"ZGhh\" kkkk") - private void methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk1() /* TODO remove or change the method's name */ { - AllureStepLogger.info("METHOD from *hell* SG-TLNR DDFGÖJJ HHHHywG \"ZGhh\" kkkk"); - AllureStepLogger.makeScreenshot(); - } - - - @Step("METHOD from *hell* SG-TLNR DDFGÖJJ HHHHywG \"ZGhh\" kkkk") - private void methodFromHellSgTlnrDdfgoejjHhhhywgZghhkkkk2() /* TODO remove or change the method's name */ { - AllureStepLogger.info("METHOD from *hell* SG-TLNR DDFGÖJJ HHHHywG \"ZGhh\" kkkk"); - AllureStepLogger.makeScreenshot(); - } - - - @Step("METHOD from *hell* SG-TLNR & DDFGÖJJ ??? HHHHywG \"ZGhh\" kkkk") - private void methodFromHellSgTlnrDdfgoejjQuestionMarkQuestionMarkQuestionMarkHhhhywgZghhkkkk() { - AllureStepLogger.info("METHOD from *hell* SG-TLNR & DDFGÖJJ HHHHywG \"ZGhh\" kkkk"); - AllureStepLogger.makeScreenshot(); - } - - -} \ No newline at end of file diff --git a/mrchecker-playwright-framework/src/test/resources/js/gremlins.min.js b/mrchecker-playwright-framework/src/test/resources/js/gremlins.min.js new file mode 100644 index 00000000..733508e3 --- /dev/null +++ b/mrchecker-playwright-framework/src/test/resources/js/gremlins.min.js @@ -0,0 +1,2 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((e=e||self).gremlins={})}(this,(function(e){"use strict";var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,a){return e(a={exports:{}},a.exports),a.exports}var i,r=function(e){return e&&e.Math==Math&&e},t=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof a&&a)||Function("return this")(),o={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},s=function(e){try{return!!e()}catch(e){return!0}},l={}.toString,c="".split,m=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==function(e){return l.call(e).slice(8,-1)}(e)?c.call(e,""):Object(e)}:Object,u=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},d=function(e){return m(u(e))},h=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),p=function(e){return"object"==typeof e?null!==e:"function"==typeof e},b=t.document,g=p(b)&&p(b.createElement),C=function(e){return g?b.createElement(e):{}},f=!h&&!s((function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a})),y=function(e){if(!p(e))throw TypeError(String(e)+" is not an object");return e},v=function(e,a){if(!p(e))return e;var n,i;if(a&&"function"==typeof(n=e.toString)&&!p(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!p(i=n.call(e)))return i;if(!a&&"function"==typeof(n=e.toString)&&!p(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},A=Object.defineProperty,S={f:h?A:function(e,a,n){if(y(e),a=v(a,!0),y(n),f)try{return A(e,a,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[a]=n.value),e}},M=function(e,a){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:a}},T=h?function(e,a,n){return S.f(e,a,M(1,n))}:function(e,a,n){return e[a]=n,e},B=function(e,a){try{T(t,e,a)}catch(n){t[e]=a}return a},I=t["__core-js_shared__"]||B("__core-js_shared__",{}),k=n((function(e){(e.exports=function(e,a){return I[e]||(I[e]=void 0!==a?a:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),P={}.hasOwnProperty,G=function(e,a){return P.call(e,a)},E=0,L=Math.random(),w=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++E+L).toString(36)},D=!!Object.getOwnPropertySymbols&&!s((function(){return!String(Symbol())})),R=D&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,x=k("wks"),F=t.Symbol,N=R?F:F&&F.withoutSetter||w,H=function(e){return G(x,e)||(D&&G(F,e)?x[e]=F[e]:x[e]=N("Symbol."+e)),x[e]},z=Math.ceil,W=Math.floor,O=function(e){return isNaN(e=+e)?0:(e>0?W:z)(e)},_=Math.min,K=Math.max,U=Math.min,V=function(e){return function(a,n,i){var r,t,o=d(a),s=(r=o.length)>0?_(O(r),9007199254740991):0,l=function(e,a){var n=O(e);return n<0?K(n+a,0):U(n,a)}(i,s);if(e&&n!=n){for(;s>l;)if((t=o[l++])!=t)return!0}else for(;s>l;l++)if((e||l in o)&&o[l]===n)return e||l||0;return!e&&-1}},J={includes:V(!0),indexOf:V(!1)},j={},Y=J.indexOf,Z=function(e,a){var n,i=d(e),r=0,t=[];for(n in i)!G(j,n)&&G(i,n)&&t.push(n);for(;a.length>r;)G(i,n=a[r++])&&(~Y(t,n)||t.push(n));return t},q=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Q=Object.keys||function(e){return Z(e,q)},X=h?Object.defineProperties:function(e,a){y(e);for(var n,i=Q(a),r=i.length,t=0;r>t;)S.f(e,n=i[t++],a[n]);return e},$=t,ee=function(e){return"function"==typeof e?e:void 0},ae=function(e,a){return arguments.length<2?ee($[e])||ee(t[e]):$[e]&&$[e][a]||t[e]&&t[e][a]},ne=ae("document","documentElement"),ie=k("keys"),re=function(e){return ie[e]||(ie[e]=w(e))},te=re("IE_PROTO"),oe=function(){},se=function(e){return"