-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
1 parent
8b7082c
commit 6d46c29
Showing
12 changed files
with
235 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: E2E pool | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
instances: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Retrieve instance | ||
id: retrieve_instance | ||
env: | ||
SALEOR_CLI_ENV: staging | ||
run: | | ||
echo "Getting instance"... | ||
npx saleor login --headless --token=${{ secrets.STAGING_API_TOKEN }} | ||
NAME=$(node scripts/pick-e2e-instance.js | jq -r .name) | ||
echo "POOL_NAME=$NAME" >> $GITHUB_OUTPUT | ||
echo "POOL_INSTANCE=https://$NAME.staging.saleor.cloud" >> $GITHUB_OUTPUT | ||
outputs: | ||
pollIntance: | ||
run-tests: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shard: [1/2, 2/2] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run tests | ||
env: | ||
API_URI: "${{ needs.instances.outputs.POOL_INSTANCE }}/graphql/" | ||
API_URI: "${{ steps.retrieve_instance.outputs.POOL_INSTANCE }}/graphql/" | ||
BASE_URL: "${{ steps.retrieve_instance.outputs.POOL_INSTANCE }}/dashboard/" | ||
E2E_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} | ||
E2E_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} | ||
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} | ||
run: | | ||
echo "Running tests on: $API_URI" | ||
echo "Base url $BASE_URL" | ||
npx playwright test --shard ${{ matrix.shard }} | ||
- name: Release instance | ||
if: always() | ||
run: node scripts/release-e2e-instance.js ${{ steps.retrieve_instance.outputs.POOL_NAME }} | ||
- name: Upload blob report to GitHub Actions Artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: all-blob-reports | ||
path: blob-report | ||
retention-days: 1 | ||
|
||
merge-reports: | ||
if: always() | ||
needs: [run-tests] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Download blob reports from GitHub Actions Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: all-blob-reports | ||
path: all-blob-reports | ||
|
||
- name: Merge into HTML Report | ||
run: npx playwright merge-reports --reporter html ./all-blob-reports | ||
|
||
- name: Upload HTML report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: html-report--attempt-${{ github.run_attempt }} | ||
path: playwright-report | ||
retention-days: 14 |
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 |
---|---|---|
|
@@ -30,4 +30,11 @@ export const USERS = { | |
email: "[email protected]", | ||
info: "Inactive user used in activation user test", | ||
}, | ||
userForPasswordReset: { | ||
email: "[email protected]", | ||
newPassword: "4321test", | ||
info: "User used in reset password test", | ||
name: "e2e", | ||
lastName: "user", | ||
}, | ||
}; |
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,34 @@ | ||
import { MailpitService } from "@api/mailpit"; | ||
import type { APIRequestContext, Locator, Page } from "@playwright/test"; | ||
|
||
export class SetUpNewPasswordPage { | ||
readonly page: Page; | ||
readonly passwordInput: Locator; | ||
readonly confirmPasswordInput: Locator; | ||
readonly setNewPasswordButton: Locator; | ||
readonly mailpitService: MailpitService; | ||
|
||
constructor(page: Page, request: APIRequestContext) { | ||
this.page = page; | ||
this.mailpitService = new MailpitService(request); | ||
this.passwordInput = page.getByTestId("password"); | ||
this.confirmPasswordInput = page.getByTestId("confirm-password"); | ||
this.setNewPasswordButton = page.getByTestId("button-bar-confirm"); | ||
} | ||
|
||
async typePassword(password: string) { | ||
await this.passwordInput.fill(password); | ||
} | ||
async typeConfirmedPassword(password: string) { | ||
await this.confirmPasswordInput.fill(password); | ||
} | ||
async clickSetNewPasswordButton() { | ||
await this.setNewPasswordButton.click(); | ||
} | ||
|
||
async gotoUserResetPasswordPage(userEmail: string) { | ||
const resetPasswordPageUrl = | ||
await this.mailpitService.generateResetPasswordUrl(userEmail); | ||
await this.page.goto(resetPasswordPageUrl); | ||
} | ||
} |
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
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