diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml new file mode 100644 index 0000000..0819c7a --- /dev/null +++ b/.github/workflows/browserstack.yml @@ -0,0 +1,34 @@ +- name: 'BrowserStack Env Setup' + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: 'BUILD_INFO' + project-name: 'REPO_NAME' + + jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + + # - name: Install Chrome for Testing and its driver + # run: | + # npm i puppeteer + # npx @puppeteer/browsers install chrome@stable + + - name: Build with Maven + run: mvn verify --file pom.xml + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@4.1.1 + with: + branch: gh-pages # The branch the action should deploy to. + folder: target/site/serenity # The folder the action should deploy. diff --git a/src/test/resources/serenity.conf b/src/test/resources/serenity.conf index 9b270c7..9434ea4 100644 --- a/src/test/resources/serenity.conf +++ b/src/test/resources/serenity.conf @@ -1,169 +1,98 @@ +# +# BROWSERSTACK TEST EXECUTION +# You define the BrowserStack credentials either in the BROWSERSTACK_USER and BROWSERSTACK_KEY environment variables +# webdriver { base.url = "http://todomvc.com/examples/angularjs/#/" - driver = chrome - capabilities { - browserName = "chrome" - acceptInsecureCerts = true - unhandledPromptBehavior = accept - "goog:chromeOptions" { - args = ["test-type", "ignore-certificate-errors", "--window-size=1000,800", - "--remote-allow-origins=*","incognito", "disable-infobars", "disable-gpu", - "disable-default-apps", "disable-popup-blocking"] - } - } -} -headless.mode = true - -serenity { - project.name = "Serenity BDD TodoMVC" - test.root = "net.serenitybdd.demos.todos" - tag.failures = "true" - linked.tags = "issue" - restart.browser.for.each = scenario - logging = verbose - # - # Use these options to reduce the size of the reports - # - # Report on test durations - report.test.durations = true - take.screenshots=FOR_FAILURES - # Store HTML source for each page - # (can be: ALWAYS, FAILURES or NEVER) -// store.html = FAILURES + driver = "remote" + remote.url = "https://"${BROWSERSTACK_USERNAME}":"${BROWSERSTACK_ACCESS_KEY}"@hub.browserstack.com/wd/hub" } -// Default page configuration -home.page = "http://todomvc.com/examples/angularjs/#/" - -environment = browserstack +environment = edge_windows_10 environments { - local { - home.page = "http://localhost:8080/angularjs/#/" - } - prod { - home.page = "http://todomvc.com/examples/angularjs/#/" - } - chrome { + chrome_windows_11 { webdriver { - driver = chrome - autodownload = true capabilities { - browserName = "chrome" + browserName = "Chrome" acceptInsecureCerts = true "goog:chromeOptions" { args = ["test-type", "ignore-certificate-errors", "headless", "--window-size=1000,800" "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"] } - } - } - } - edge { - webdriver { - capabilities { - browserName = "MicrosoftEdge" - "ms:edgeOptions" { - args = ["test-type", "ignore-certificate-errors", "headless", - "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"] + "bstack:options" { + os = "Windows" + osVersion = "11" + browserVersion = "latest" + resolution = "1920x1200" + idleTimeout = 600 } } } } - firefox { + edge_windows_10 { webdriver { capabilities { - browserName = "firefox" - pageLoadStrategy = "normal" + browserName = "Edge" acceptInsecureCerts = true - unhandledPromptBehavior = "dismiss" - strictFileInteractability = true - - "moz:firefoxOptions" { - args = ["-headless"], - prefs { - "javascript.options.showInConsole": false - }, - log {"level": "info"}, + "bstack:options" { + os = "Windows" + osVersion = "10" + browserVersion = "latest" + resolution = "1920x1200" + idleTimeout = 600 } } } } - lambdatest { - home.page = "http://todomvc.com/examples/angularjs/#/" - # - # You define the Lambdatest credentials either in the LT_USERNAME and LT_ACCESS_KEY environment variables, or by - # setting the following properties: - # - # lt.user = your.username - # lt.key = your.access.key - # - # You can also override the Lambdatest grid url by setting the following property. - # lt.grid="hub.lambdatest.com" + firefox_windows_10 { webdriver { - driver = remote - remote.url = "https://"${LT_USERNAME}":"${LT_ACCESS_KEY}"@hub.lambdatest.com/wd/hub" capabilities { - browserName = "chrome" - "goog:chromeOptions" { - args = ["test-type", "no-sandbox", "ignore-certificate-errors", "--window-size=1000,800", - "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"] - } - "LT:options" { - platformName = "Windows 10" - } + browserName = "Firefox" + acceptInsecureCerts = true } } - } - browserstack { - home.page = "http://todomvc.com/examples/angularjs/#/" - # - # You define the BrowserStack credentials either in the BROWSERSTACK_USER and BROWSERSTACK_KEY environment variables - # - webdriver { - driver = "remote" - remote.url = "https://"${BROWSERSTACK_USER}":"${BROWSERSTACK_KEY}"@hub.browserstack.com/wd/hub" - # You can specify the remote URL explicitly, or let the serenity-browserstack library do it for you - capabilities { - browserName = "Chrome" - # - # Any Browserstack-specific options go in the 'bstack:Options' section - # - "bstack:options" { - os = "Windows" - osVersion = "11" - browserVersion = "latest" - local = false - resolution = "1920x1200" - seleniumVersion = "4.6.0" - video = true - idleTimeout = 600 - } - } + "bstack:options" { + os = "Windows" + osVersion = "10" + browserVersion = "latest" + resolution = "1920x1200" + idleTimeout = 600 } } - saucelabs { - home.page = "http://todomvc.com/examples/angularjs/#/" - # - # You define the BrowserStack credentials either in the BROWSERSTACK_USER and BROWSERSTACK_KEY environment variables, or by - # setting the following properties: - # - # browserstack.user = your.username - # browserstack.key = your.access.key - # + safari_osx { webdriver { - driver = "remote" - remote.url = "https://"${SAUCE_USERNAME}":"${SAUCE_ACCESS_KEY}"@ondemand.us-west-1.saucelabs.com:443/wd/hub" - - platformName = "Windows 11" capabilities { - browserName = "Chrome" + browserName = "Safari" + acceptInsecureCerts = true + } + "bstack:options" { + os = "OS X" + osVersion = "Sonoma" browserVersion = "latest" - # - # Any Saucelabs-specific options go in the 'sauce:Options' sectipn - # - "sauce:options" { - screenResolution = "1920x1200" - } + resolution = "1920x1200" + idleTimeout = 600 } } } } + +headless.mode = true + +serenity { + project.name = "Serenity BDD TodoMVC" + tag.failures = "true" + linked.tags = "issue" + restart.browser.for.each = scenario + logging = verbose + # + # Use these options to reduce the size of the reports + # + # Report on test durations + report.test.durations = true + take.screenshots = FOR_EACH_ACTION + # Store HTML source for each page + # (can be: FOR_EACH_ACTION, BEFORE_AND_AFTER_EACH_STEP, FOR_FAILURES or DISABLED) + # store.html = FAILURES +} +# Default page configuration +home.page = "http://todomvc.com/examples/angularjs/#/"