diff --git a/Jenkinsfile_nightly b/Jenkinsfile_nightly index 67952938cd..d9c4ce2c57 100644 --- a/Jenkinsfile_nightly +++ b/Jenkinsfile_nightly @@ -28,8 +28,10 @@ def secrets = [ secret('test-email', 'TEST_EMAIL'), secret('test-password', 'TEST_PASSWORD'), secret('appinsights-instrumentationkey-mc', 'APPINSIGHTS_INSTRUMENTATIONKEY'), + secret('appinsights-connection-string-mc', 'APPINSIGHTS_CONNECTION_STRING'), secret('system-user-name', 'SYSTEM_USER_NAME'), - secret('system-user-password', 'SYSTEM_USER_PASSWORD') + secret('system-user-password', 'SYSTEM_USER_PASSWORD'), + secret('launch-darkly-client-id', 'LAUNCH_DARKLY_CLIENT_ID'), ], ] @@ -43,23 +45,21 @@ static LinkedHashMap secret(String secretName, String envVar) { } withNightlyPipeline(type, product, component) { - env.TEST_URL = 'https://manage-case.aat.platform.hmcts.net/' + enableSlackNotifications(channel) loadVaultSecrets(secrets) + env.TEST_URL = 'https://manage-case.aat.platform.hmcts.net' enableFortifyScan('rpx-aat') enableFullFunctionalTest(120) - // enableSecurityScan() - //enableMutationTest() - enableCrossBrowserTest() - + afterSuccess('checkout') { yarnBuilder.yarn('cache clean') } - + afterSuccess('build') { yarnBuilder.yarn('build') - + publishHTML([ allowMissing : true, alwaysLinkToLastBuild: true, @@ -76,7 +76,23 @@ withNightlyPipeline(type, product, component) { reportFiles : 'index.html', reportName : 'ng lint Report' ]) - + stage('Cross Browser Test') { + try { + yarnBuilder.yarn('test:crossbrowser') + } catch (Error) { + unstable(message: "${STAGE_NAME} is unstable: " + Error.toString()) + } finally { + publishHTML([ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "reports/tests/crossbrowser/", + reportFiles : 'index.html', + reportName : 'XUI Manage Cases Cross Browser Tests' + ]) + steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'reports/tests-results/CaseAPIFunctional/*' + } + } // yarnBuilder.yarn('test:a11y') // publishHTML([ // allowMissing : true, @@ -132,17 +148,6 @@ withNightlyPipeline(type, product, component) { ]) } - afterSuccess('crossBrowserTest') { - publishHTML([ - allowMissing : true, - alwaysLinkToLastBuild: true, - keepAll : true, - reportDir : "reports/tests/crossbrowser/", - reportFiles : 'index.html', - reportName : 'XUI Manage Cases Cross Browser Tests' - ]) - } - afterSuccess('securityScan') { publishHTML([ allowMissing : true, diff --git a/package.json b/package.json index 9c6e908d49..f1d16b2436 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "test:all": "yarn test:ng && yarn test:node && yarn test:smoke && yarn test:functional && yarn test:crossbrowser", "test:smoke": "yarn playwright install chromium && TEST_TYPE=smoke npx codeceptjs run --plugins cucumberJsonReporter --plugins retryFailedStep --config ./test_codecept/codeceptCommon/codecept.conf.ts --features --grep @smoke --reporter mochawesome", "test:smoke:local": "webdriver-manager update --versions.chrome 2.40 && protractor ./test/e2e/config/smoke.conf.js --local", - "test:crossbrowser": "protractor ./test/e2e/config/crossbrowser.conf.js", + "test:crossbrowser": "yarn playwright install && npx playwright test -c playwright-nightly.config.ts", "test:fullfunctional": "yarn playwright install && npm-run-all -p -l -n -c test:api test:xuiIntegration test:codeceptE2E", "test:playwrightE2E": "yarn playwright install && npx playwright test --project chromium", "test:functional1": "yarn run test:xuiIntegration && yarn run test:functionalApiE2e", diff --git a/playwright-nightly.config.ts b/playwright-nightly.config.ts new file mode 100644 index 0000000000..d9a53b8b54 --- /dev/null +++ b/playwright-nightly.config.ts @@ -0,0 +1,62 @@ +import { defineConfig, devices } from '@playwright/test'; + +const headlessMode = process.env.HEAD !== 'true'; +export const axeTestEnabled = process.env.ENABLE_AXE_TESTS === 'true'; + +module.exports = defineConfig({ + testDir: './playwright_tests/E2E', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: 3, // Set the number of retries for all projects + + timeout: 3 * 60 * 1000, + expect: { + timeout: 1 * 60 * 1000 + }, + reportSlowTests: null, + + /* Opt out of parallel tests on CI. */ + workers: process.env.FUNCTIONAL_TESTS_WORKERS ? parseInt(process.env.FUNCTIONAL_TESTS_WORKERS, 10) : 1, + + reporter: [[process.env.CI ? 'html' : 'list'], + ['html', { open: 'never', outputFolder: 'functional-output/tests/playwright-e2e' }]], + + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'], + channel: 'chrome', + headless: headlessMode, + trace: 'on-first-retry' + } + }, + { + name: 'firefox', + use: { ...devices['Desktop Firefox'], + screenshot: 'only-on-failure', + headless: headlessMode, + trace: 'off' + } + }, + { + name: 'webkit', + use: { ...devices['Desktop Safari'], + screenshot: 'only-on-failure', + headless: headlessMode, + trace: 'off' + } + } + // { + // name: 'MicrosoftEdge', + // use: { ...devices['Desktop Edge'], + // channel: 'msedge', + // screenshot: 'only-on-failure', + // headless: headlessMode, + // trace: 'off' + // } + // } + ] +}); diff --git a/test_codecept/java/build.gradle b/test_codecept/java/build.gradle index 4d562c181d..a43a00ca8b 100644 --- a/test_codecept/java/build.gradle +++ b/test_codecept/java/build.gradle @@ -4,7 +4,7 @@ plugins { } sourceCompatibility = 11 -targetCompatibility = 11 +targetCompatibility = 17 // tag::repositories[] repositories {