From 7bceac6a36a7981a84431f4ff043397f43577e74 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Fri, 11 Apr 2025 12:06:05 +0200 Subject: [PATCH] .github: new stage user on each playwright run --- .github/workflows/playwright.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f72a362f..17c88763 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -54,7 +54,22 @@ jobs: - name: Run front-end Playwright tests env: BASE_URL: https://stage.foo.redhat.com:1337 - run: CURRENTS_PROJECT_ID=hIU6nO CURRENTS_RECORD_KEY=$CURRENTS_RECORD_KEY npx playwright test + run: | + export PLAYWRIGHT_USER=image-builder-playwright-$RANDOM + export PLAYWRIGHT_PASSWORD=image-builder-playwright-$(uuidgen) + # Step 1: Create a new empty account + curl -k -X POST https://account-manager-stage.app.eng.rdu2.redhat.com/account/new -d "{\"username\": \"$PLAYWRIGHT_USER\", \"password\":\"$PLAYWRIGHT_PASSWORD\"}" + # Step 2: Attach subscriptions to the new account + curl -k -X POST https://account-manager-stage.app.eng.rdu2.redhat.com/account/attach \ + -d "{\"username\": \"$PLAYWRIGHT_USER\", \"password\":\"$PLAYWRIGHT_PASSWORD\", \"sku\":[\"RH00003\"],\"quantity\": 1}" + # Step 3: Activate the new account by accepting Terms and Conditions + curl -k -X POST https://account-manager-stage.app.eng.rdu2.redhat.com/account/activate -d "{\"username\": \"$PLAYWRIGHT_USER\", \"password\":\"$PLAYWRIGHT_PASSWORD\"}" + # Step 4: Refresh account to update subscription pools + curl -k -X POST https://account-manager-stage.app.eng.rdu2.redhat.com/account/refresh -d "{\"username\": \"$PLAYWRIGHT_USER\", \"password\":\"$PLAYWRIGHT_PASSWORD\"}" + # Step 5: View account to check account status + curl -k -X GET "https://account-manager-stage.app.eng.rdu2.redhat.com/account/get?username=$PLAYWRIGHT_USER&password=$PLAYWRIGHT_PASSWORD" + + CURRENTS_PROJECT_ID=hIU6nO CURRENTS_RECORD_KEY=$CURRENTS_RECORD_KEY npx playwright test - name: Store front-end Test report uses: actions/upload-artifact@v4