-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
968 additions
and
950 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
on: [push] | ||
|
||
jobs: | ||
npm-build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: Build Docker image check | ||
on: | ||
pull_request: | ||
types: [closed] | ||
jobs: | ||
docker_build: | ||
name: Build Docker image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ jobs: | |
run: npm run e2e | ||
timeout-minutes: 40 | ||
env: | ||
E2E_TEST_ENV: ${{ inputs.environment != null && inputs.environment || 'local' }} | ||
E2E_TEST_ENV: ${{ inputs.environment != null && inputs.environment || 'stage' }} | ||
E2E_TEST_BASE_URL: ${{ secrets.E2E_TEST_BASE_URL }} | ||
E2E_TEST_ACCOUNT_EMAIL: ${{ secrets.E2E_TEST_ACCOUNT_EMAIL }} | ||
E2E_TEST_ACCOUNT_PASSWORD: ${{ secrets.E2E_TEST_ACCOUNT_PASSWORD }} | ||
|
@@ -76,6 +76,7 @@ jobs: | |
name: test-results | ||
path: src/e2e/test-results/ | ||
retention-days: 30 | ||
|
||
- name: Send GitHub Action trigger data to Slack workflow | ||
id: slack | ||
uses: slackapi/[email protected] | ||
|
@@ -89,7 +90,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Link to job:* *<https://github.com/mozilla/blurts-server/actions/runs/${{ github.run_id }}|Monitor E2E tests>*" | ||
"text": "*Link to job:* *<https://github.com/mozilla/blurts-server/actions/runs/${{ github.run_id }}|Monitor e2e tests>*" | ||
} | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
name: Deploy Preview | ||
|
||
on: | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
env: | ||
PROJECT_ID: ${{ secrets.GCP_PROJECT }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
on: [push] | ||
|
||
jobs: | ||
unit-tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import { parseIso8601Datetime } from "../../../utils/parse"; | ||
|
||
export function isPrePlusDate( | ||
plusReleaseDateString: string, | ||
dateStringToCompare: string, | ||
) { | ||
const brokerScanReleaseDateParts = plusReleaseDateString.split("-"); | ||
if (brokerScanReleaseDateParts[0] === "") { | ||
brokerScanReleaseDateParts[0] = "2023"; | ||
} | ||
const brokerScanReleaseDate = new Date( | ||
Date.UTC( | ||
Number.parseInt(brokerScanReleaseDateParts[0], 10), | ||
Number.parseInt(brokerScanReleaseDateParts[1] ?? "12", 10) - 1, | ||
Number.parseInt(brokerScanReleaseDateParts[2] ?? "05", 10), | ||
), | ||
); | ||
|
||
return ( | ||
(parseIso8601Datetime(dateStringToCompare)?.getTime() ?? 0) < | ||
brokerScanReleaseDate.getTime() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import { isPrePlusDate } from "../../app/functions/universal/isPrePlusDate.js"; | ||
import { test, expect } from "../fixtures/basePage.js"; | ||
|
||
test.describe(`${process.env.E2E_TEST_ENV} - Authentication flow verification @smoke`, () => { | ||
|
@@ -14,7 +15,7 @@ test.describe(`${process.env.E2E_TEST_ENV} - Authentication flow verification @s | |
authPage, | ||
landingPage, | ||
}, testInfo) => { | ||
// speed up test by ignore non necessary requests | ||
// speed up test by ignoring non-necessary requests | ||
await page.route(/(analytics)/, async (route) => { | ||
await route.abort(); | ||
}); | ||
|
@@ -23,12 +24,20 @@ test.describe(`${process.env.E2E_TEST_ENV} - Authentication flow verification @s | |
await landingPage.goToSignIn(); | ||
|
||
// Fill out sign up form | ||
const randomEmail = `${Date.now()}[email protected]`; | ||
const currentTimestamp = Date.now(); | ||
const randomEmail = `${currentTimestamp}[email protected]`; | ||
await authPage.signUp(randomEmail, page); | ||
|
||
// assert successful login | ||
const successUrl = `${process.env.E2E_TEST_BASE_URL}/user/welcome`; | ||
expect(page.url()).toBe(successUrl); | ||
const successUrlSlugs = isPrePlusDate( | ||
process.env.BROKER_SCAN_RELEASE_DATE ?? "", | ||
new Date(currentTimestamp).toUTCString(), | ||
) | ||
? "/user/dashboard" | ||
: "/user/welcome"; | ||
expect(page.url()).toBe( | ||
`${process.env.E2E_TEST_BASE_URL}${successUrlSlugs}`, | ||
); | ||
|
||
await testInfo.attach( | ||
`${process.env.E2E_TEST_ENV}-signup-monitor-dashboard.png`, | ||
|
Oops, something went wrong.