Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ runs:
env:
PLAYWRIGHT_TARGET_ENV: ${{ inputs.target }}
run: |
if [[ $PLAYWRIGHT_TARGET_ENV != "local" && $PLAYWRIGHT_TARGET_ENV != "staging" ]]; then echo "invalid e2e test target provided" && exit 1; fi
if [[ $PLAYWRIGHT_TARGET_ENV != "local" && $PLAYWRIGHT_TARGET_ENV != "staging" && $PLAYWRIGHT_TARGET_ENV != "grantor1" && $PLAYWRIGHT_TARGET_ENV != "grantor2" && $PLAYWRIGHT_TARGET_ENV != "grantee1" && $PLAYWRIGHT_TARGET_ENV != "grantee2" ]]; then echo "invalid e2e test target provided" && exit 1; fi

- name: Check out code
uses: actions/checkout@v6
Expand Down Expand Up @@ -133,7 +133,20 @@ runs:
if [[ ${{ inputs.target }} = "staging" ]]; then
echo "base_url=https://staging.simpler.grants.gov" >> "$GITHUB_ENV"
echo "api_url=https://api.staging.simpler.grants.gov" >> "$GITHUB_ENV"
elif [[ ${{ inputs.target }} = "grantor1" ]]; then
echo "base_url=https://grantor1.teams.simpler.grants.gov" >> "$GITHUB_ENV"
echo "api_url=https://api.grantor1.teams.simpler.grants.gov" >> "$GITHUB_ENV"
elif [[ ${{ inputs.target }} = "grantor2" ]]; then
echo "base_url=https://grantor2.teams.simpler.grants.gov" >> "$GITHUB_ENV"
echo "api_url=https://api.grantor2.teams.simpler.grants.gov" >> "$GITHUB_ENV"
elif [[ ${{ inputs.target }} = "grantee1" ]]; then
echo "base_url=https://grantee1.teams.simpler.grants.gov" >> "$GITHUB_ENV"
echo "api_url=https://api.grantee1.teams.simpler.grants.gov" >> "$GITHUB_ENV"
elif [[ ${{ inputs.target }} = "grantee2" ]]; then
echo "base_url=https://grantee2.teams.simpler.grants.gov" >> "$GITHUB_ENV"
echo "api_url=https://api.grantee2.teams.simpler.grants.gov" >> "$GITHUB_ENV"
fi

- name: Run all e2e tests (Shard ${{ inputs.current_shard }}/${{ inputs.total_shards }})
if: ${{ inputs.playwright_tags == '' }}
working-directory: ./frontend
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/e2e-create-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,26 @@ jobs:
# run: |
# npx playwright install --with-deps

- name: Check target environment
run: |
if [[ "${{ inputs.target }}" != "local" && "${{ inputs.target }}" != "staging" && "${{ inputs.target }}" != "grantee1" && "${{ inputs.target }}" != "grantee2" && "${{ inputs.target }}" != "grantor1" && "${{ inputs.target }}" != "grantor2" ]]; then
echo "Unsupported target environment"
exit 1
fi
- name: Set target environment
run: |
if [[ -z "${{ inputs.target }}" ]]; then
echo "defaulted_target=staging" >> "$GITHUB_ENV";
else
echo "defaulted_target=${{ inputs.target }}" >> "$GITHUB_ENV";
fi

- name: Download All Blob Reports
uses: actions/download-artifact@v7
with:
path: frontend/all-blob-reports
run-id: ${{ inputs.run_id }}
pattern: blob-report-shard-${{ inputs.target }}-*
pattern: blob-report-shard-${{ env.defaulted_target }}-*
merge-multiple: true
- name: Verify Downloaded Artifacts
run: |
Expand All @@ -75,6 +89,6 @@ jobs:
- name: Upload Merged HTML Report
uses: actions/upload-artifact@v7
with:
name: merged-html-report-${{ inputs.target }}
name: merged-html-report-${{ env.defaulted_target }}
path: frontend/playwright-report
retention-days: 30
21 changes: 18 additions & 3 deletions .github/workflows/e2e-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
type: choice
options:
- staging
- grantee1
- grantee2
- grantor1
- grantor2
playwright_tags:
description: "pipe separated list of @tags denoting groups of tests to run (e.g. @smoke|@core-regression). Leave blank to run all tests"
type: string
Expand All @@ -39,10 +43,21 @@ jobs:
e2e-tests-deployed:
runs-on: ubuntu-22.04
steps:
- name: Check target environment
run: |
if [[ "${{ inputs.target }}" != "staging" && "${{ inputs.target }}" != "grantee1" && "${{ inputs.target }}" != "grantee2" && "${{ inputs.target }}" != "grantor1" && "${{ inputs.target }}" != "grantor2" ]]; then
echo "Unsupported target environment"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v6
- name: Set target
run: if [[ -z "${{ inputs.target }}" ]]; then echo "defaulted_target=staging" >> "$GITHUB_ENV"; else echo "defaulted_target=${{ inputs.target }}" >> "$GITHUB_ENV"; fi
- name: Set target environment
run: |
if [[ -z "${{ inputs.target }}" ]]; then
echo "defaulted_target=staging" >> "$GITHUB_ENV";
else
echo "defaulted_target=${{ inputs.target }}" >> "$GITHUB_ENV";
fi
- name: Determine test groups to run
shell: bash
run: |
Expand Down Expand Up @@ -74,7 +89,7 @@ jobs:
secrets: inherit
with:
run_id: ${{ github.run_id }}
target: ${{ inputs.target || 'staging' }}
target: ${{ inputs.target }}
send-slack-notification:
if: failure()
needs: [create-report]
Expand Down
2 changes: 2 additions & 0 deletions frontend/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ CI=
# Only needed if running end-to-end tests with Playwright
# See: frontend/tests/e2e/playwright-env.ts


# Target environment info for playwright tests
# Defaults to local, set to staging, or grantor/grantee environment to run tests there instead
PLAYWRIGHT_TARGET_ENV=
Expand All @@ -147,3 +148,4 @@ TEST_USER_MANAGER_API_KEY=local-manager-key
# Playwright shard configuration (for parallel test execution)
TOTAL_SHARDS=
CURRENT_SHARD=

6 changes: 6 additions & 0 deletions frontend/tests/e2e/apply/fixtures/general-apply-fixtures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import playwrightEnv from "tests/e2e/playwright-env";

export const OPPORTUNITY_ID =
playwrightEnv.targetEnv !== "local"
? "39df8091-6e99-4b0f-9db7-1f3aca9cb6e5"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
BUDGET_NARRATIVE_ATTACHMENT_FORM_MATCHER,
BUDGET_NARRATIVE_ATTACHMENT_REQUIRED_FIELD_ERRORS,
} from "tests/e2e/apply/fixtures/budget-narrative-attachment-field-definitions";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
Expand All @@ -27,15 +28,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39df8091-6e99-4b0f-9db7-1f3aca9cb6e5
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39df8091-6e99-4b0f-9db7-1f3aca9cb6e5"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
CD511_FORM_MATCHER,
CD511_REQUIRED_FIELD_ERRORS,
} from "tests/e2e/apply/fixtures/cd511-field-definitions";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
import { getOpportunityId } from "tests/e2e/utils/application/get-opportunityId-utils";
import { authenticateE2eUser } from "tests/e2e/utils/auth/authenticate-e2e-user-utils";
import { skipNonChromeOnStaging } from "tests/e2e/utils/auth/skip-non-chrome-staging-utils";
import { openForm } from "tests/e2e/utils/forms/form-navigation-utils";
Expand All @@ -30,7 +30,7 @@ import {
const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;

const { testOrgLabel } = playwrightEnv;
const OPPORTUNITY_URL = `/opportunity/${getOpportunityId()}`;
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
test.beforeEach(({ page: _ }, testInfo) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
fieldDefinitionsEPAKeyContacts,
} from "tests/e2e/apply/fixtures/epa-key-contacts-field-definitions";
import { epaKeyContactsFailurePathTestData } from "tests/e2e/apply/fixtures/epa-key-contacts-fill-data";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
Expand All @@ -30,15 +31,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39cf0a5c-5fed-40b4-8f46-5374101ae419
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39cf0a5c-5fed-40b4-8f46-5374101ae419"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
EPA4700_4_FORM_MATCHER,
EPA4700_4_REQUIRED_FIELD_ERRORS,
} from "tests/e2e/apply/fixtures/epa4700-4-field-definitions";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
import { getOpportunityId } from "tests/e2e/utils/application/get-opportunityId-utils";
import { authenticateE2eUser } from "tests/e2e/utils/auth/authenticate-e2e-user-utils";
import { skipNonChromeOnStaging } from "tests/e2e/utils/auth/skip-non-chrome-staging-utils";
import { openForm } from "tests/e2e/utils/forms/form-navigation-utils";
Expand All @@ -30,7 +30,7 @@ import {
const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;

const { testOrgLabel } = playwrightEnv;
const OPPORTUNITY_URL = `/opportunity/${getOpportunityId()}`;
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
test.beforeEach(({ page: _ }, testInfo) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
GRANTSGOV_LOBBYING_FORM_MATCHER,
GRANTSGOV_LOBBYING_REQUIRED_FIELD_ERRORS,
Expand All @@ -27,15 +28,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39cf0a5c-5fed-40b4-8f46-5374101ae419
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39cf0a5c-5fed-40b4-8f46-5374101ae419"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
OTHER_NARRATIVE_ATTACHMENT_FORM_MATCHER,
OTHER_NARRATIVE_ATTACHMENT_REQUIRED_FIELD_ERRORS,
Expand All @@ -27,15 +28,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39df8091-6e99-4b0f-9db7-1f3aca9cb6e5
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39df8091-6e99-4b0f-9db7-1f3aca9cb6e5"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
PROJECT_ABSTRACT_SUMMARY_FORM_MATCHER,
PROJECT_ABSTRACT_SUMMARY_REQUIRED_FIELD_ERRORS,
} from "tests/e2e/apply/fixtures/project-abstract-summary-field-definitions";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
import { getOpportunityId } from "tests/e2e/utils/application/get-opportunityId-utils";
import { authenticateE2eUser } from "tests/e2e/utils/auth/authenticate-e2e-user-utils";
import { skipNonChromeOnStaging } from "tests/e2e/utils/auth/skip-non-chrome-staging-utils";
import { openForm } from "tests/e2e/utils/forms/form-navigation-utils";
Expand All @@ -29,7 +29,7 @@ import {

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel } = playwrightEnv;
const OPPORTUNITY_URL = `/opportunity/${getOpportunityId()}`;
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
test.beforeEach(({ page: _ }, testInfo) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
PROJECT_ABSTRACT_FORM_MATCHER,
PROJECT_ABSTRACT_REQUIRED_FIELD_ERRORS,
Expand All @@ -27,15 +28,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39cf0a5c-5fed-40b4-8f46-5374101ae419
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39cf0a5c-5fed-40b4-8f46-5374101ae419"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
PROJECT_NARRATIVE_ATTACHMENT_FORM_MATCHER,
PROJECT_NARRATIVE_ATTACHMENT_REQUIRED_FIELD_ERRORS,
Expand All @@ -27,15 +28,8 @@ import {
} from "tests/e2e/utils/forms/verify-form-status-utils";

const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;
const { testOrgLabel, targetEnv } = playwrightEnv;
const { testOrgLabel } = playwrightEnv;

// Environment-specific opportunity IDs
// Staging: 39df8091-6e99-4b0f-9db7-1f3aca9cb6e5
// Local: c3c59562-a54f-4203-b0f6-98f2f0383481
const OPPORTUNITY_ID =
targetEnv === "staging"
? "39df8091-6e99-4b0f-9db7-1f3aca9cb6e5"
: "c3c59562-a54f-4203-b0f6-98f2f0383481";
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
type Page,
type TestInfo,
} from "@playwright/test";
import { OPPORTUNITY_ID } from "tests/e2e/apply/fixtures/general-apply-fixtures";
import {
SF424_FORM_MATCHER,
SF424_REQUIRED_FIELD_ERRORS,
} from "tests/e2e/apply/fixtures/sf424-field-definitions";
import playwrightEnv from "tests/e2e/playwright-env";
import { VALID_TAGS } from "tests/e2e/tags";
import { createApplication } from "tests/e2e/utils/application/create-application-utils";
import { getOpportunityId } from "tests/e2e/utils/application/get-opportunityId-utils";
import { authenticateE2eUser } from "tests/e2e/utils/auth/authenticate-e2e-user-utils";
import { skipNonChromeOnStaging } from "tests/e2e/utils/auth/skip-non-chrome-staging-utils";
import { openForm } from "tests/e2e/utils/forms/form-navigation-utils";
Expand All @@ -30,7 +30,7 @@ import {
const { APPLY, APPLY_FORMS, CORE_REGRESSION } = VALID_TAGS;

const { testOrgLabel } = playwrightEnv;
const OPPORTUNITY_URL = `/opportunity/${getOpportunityId()}`;
const OPPORTUNITY_URL = `/opportunity/${OPPORTUNITY_ID}`;

// Skip non-Chrome browsers in staging
test.beforeEach(({ page: _ }, testInfo) => {
Expand Down
Loading
Loading