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
18 changes: 0 additions & 18 deletions .github/workflows/reusable-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,30 +142,13 @@ jobs:
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3

- name: Restore ui/dist cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-ui-cache
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ inputs.commit }}

- name: Restore ${{ matrix.package }}/dist cache
id: restore-package-cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ./packages/${{ matrix.package }}/dist
key: ${{ runner.os }}-${{ matrix.package }}-${{ inputs.commit }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

- name: Install packages
if: steps.restore-cache.outputs.cache-hit != 'true' || steps.restore-cypress-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/install-with-retries
with:
skip-cypress-binary: false

- name: Build @aws-amplify/ui package
if: steps.restore-ui-cache.outputs.cache-hit != 'true'
run: yarn ui build

- name: Build react-core package
Expand All @@ -177,7 +160,6 @@ jobs:
run: yarn react-core-notifications build

- name: Build ${{ matrix.package }} package
if: steps.restore-package-cache.outputs.cache-hit != 'true'
run: yarn ${{ matrix.package }} build

- name: Build react-notifications package
Expand Down
67 changes: 37 additions & 30 deletions .github/workflows/reusable-setup-cache.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Description: this is a reusable workflow that sets up cache for unit and e2e testss.
# Description: this is a reusable workflow that sets up cache for unit and e2e tests.
# It checks if caches exist and populates them if missing, so downstream jobs can restore them.

on:
workflow_call:
Expand Down Expand Up @@ -26,47 +27,53 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.2 https://github.com/actions/setup-node/commit/60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 20
cache: 'yarn'
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Restore cypress runner from Cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-cypress-cache
# Skip yarn cache here - we manage node_modules cache explicitly below
# Downstream jobs will still use setup-node's yarn cache
- name: Check if Cypress cache exists
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: check-cypress-cache
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Restore Puppeteer runner from Cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-puppeteer-cache
lookup-only: true
- name: Check if Puppeteer cache exists
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: check-puppeteer-cache
with:
path: ~/.cache/puppeteer
key: ${{ runner.os }}-puppeteer-${{ hashFiles('yarn.lock') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Restore node_modules from Cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-node-modules-cache
lookup-only: true
- name: Check if node_modules cache exists
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: check-node-modules-cache
with:
path: |
./node_modules
**/node_modules
key: ${{ runner.os }}-nodemodules-${{ hashFiles('yarn.lock') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
lookup-only: true
- name: Install packages
if: steps.restore-node-modules-cache.outputs.cache-hit != 'true'
if: steps.check-node-modules-cache.outputs.cache-hit != 'true' || steps.check-cypress-cache.outputs.cache-hit != 'true' || steps.check-puppeteer-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/install-with-retries
with:
# only install binary if cypress cache missed
skip-cypress-binary: ${{ steps.restore-cypress-cache.outputs.cache-hit }}
- name: Restore packages/ui/dist from Cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-ui-cache
skip-cypress-binary: ${{ steps.check-cypress-cache.outputs.cache-hit }}
- name: Cache node_modules
if: steps.check-node-modules-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ inputs.commit }}
- name: Build ui package
if: steps.restore-ui-cache.outputs.cache-hit != 'true'
run: yarn ui build
path: |
./node_modules
**/node_modules
key: ${{ runner.os }}-nodemodules-${{ hashFiles('yarn.lock') }}
- name: Cache Cypress
if: steps.check-cypress-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
- name: Cache Puppeteer
if: steps.check-puppeteer-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.cache/puppeteer
key: ${{ runner.os }}-puppeteer-${{ hashFiles('yarn.lock') }}
16 changes: 1 addition & 15 deletions .github/workflows/reusable-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,13 @@ jobs:
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3

- name: Restore ui/dist cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
id: restore-ui-cache
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ inputs.commit }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

- name: Install packages
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/install-with-retries
with:
skip-cypress-binary: true # unit test doesn't need cypress

- name: Build ui package
if: ${{ steps.restore-ui-cache.outputs.cache-hit != 'true' && matrix.package == 'ui' }}
run: yarn ui build

- name: Build react-core package
Expand Down Expand Up @@ -135,8 +125,4 @@ jobs:
matrix.package == 'react-storage'
run: yarn ${{ matrix.package }} size

- name: Cache ${{ matrix.package }}/dist
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 https://github.com/actions/cache/commit/1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ./packages/${{ matrix.package }}/dist
key: ${{ runner.os }}-${{ matrix.package }}-${{ inputs.commit }}

8 changes: 8 additions & 0 deletions packages/e2e/cypress/integration/common/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ Then('I will be redirected to the confirm forgot password page', () => {
cy.findInputField('New Password').should('exist');
});

Then('I will be redirected to the confirm sign in page', () => {
cy.get('[data-amplify-authenticator-confirmsignin]').should('be.visible');
});

Then('I will be redirected to the setup totp page', () => {
cy.get('[data-amplify-qrcode]').should('be.visible');
});

When('I type my username with untrimmed spaces', () => {
cy.findInputField('Username').type(` ${Cypress.env('USERNAME')}+CONFIRMED `);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ When('I enter an invalid confirmation code', () => {
});
});

Then('I will be redirected to the setup totp page', () => {
cy.get('[data-amplify-qrcode]').should('be.visible');
});

Then('I check to see if QR code is correct', () => {
cy.get('img').then(($el) => {
const imagePath = $el[0]?.currentSrc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Feature: Form Fields
When I type my "email" with status "CONFIRMED"
Then I type my password
Then I click the "Sign in" button
Then I will be redirected to the setup totp page
Then 'New Label' field does not have "required"
Then I see "New Label"
Then "New Label" field does not have class "amplify-visually-hidden"
Expand All @@ -88,6 +89,7 @@ Feature: Form Fields
When I type my "email" with status "UNVERIFIED"
Then I type my password
Then I click the "Sign in" button
Then I will be redirected to the confirm sign in page
Then 'New Label' field does not have "required"
Then I see "New Label"
Then "New Label" field does not have class "amplify-visually-hidden"
Expand Down
Loading