diff --git a/.github/actions/restore-accounts/action.yml b/.github/actions/restore-accounts/action.yml index 899aab3858..d05958214e 100644 --- a/.github/actions/restore-accounts/action.yml +++ b/.github/actions/restore-accounts/action.yml @@ -29,4 +29,4 @@ runs: API_URL: ${{ inputs.API_URL }} BASE_URL: ${{ inputs.BASE_URL }} run: | - node playwright/auth.js restore $ACCOUNTS + node playwright/auth.js restore "$ACCOUNTS" diff --git a/.github/workflows/run-tests-on-release.yml b/.github/workflows/run-tests-on-release.yml index c63b2c604c..abe5454924 100644 --- a/.github/workflows/run-tests-on-release.yml +++ b/.github/workflows/run-tests-on-release.yml @@ -64,7 +64,7 @@ jobs: CHECK_ID: ${{ steps.create-check.outputs.CHECK_ID }} FRAMEWORK: ${{ steps.check-framework.outputs.result }} IS_OLD_VERSION: ${{ steps.get-environment-variables.outputs.IS_OLD_VERSION }} - ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}ą + ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }} steps: - uses: actions/checkout@v4 diff --git a/playwright/auth.js b/playwright/auth.js index e5c1fa1153..de6310b1af 100644 --- a/playwright/auth.js +++ b/playwright/auth.js @@ -46,19 +46,27 @@ const ACCOUNT_EMAILS = { product: "product.manager@example.com", }; -const createQuery = (email, password) => `mutation TokenAuth{ - tokenCreate(email: "${email}", password: "${password}") { - token - refreshToken - errors { - code - message +const createQuery = (email, password) => { + const query = ` + mutation TokenAuth($email: String!, $password: String!) { + tokenCreate(email: $email, password: $password) { + token + refreshToken + errors { + code + message + } + user { + id + } + } } - user { - id - } - } -}`; + ` + + const variables = { email, password } + + return { query, variables } +}; const getEmailForPermission = (permission) => { @@ -84,10 +92,9 @@ const getAuthForPermission = async (permissionName) => { const email = getEmailForPermission(permissionName); const password = getPasswordForPermission(permissionName); - const query = createQuery(email, password) const response = await apiRequestContext.post(process.env.API_URL || "", { - data: { query }, + data: createQuery(email, password), }); const resposnseObj = await response.json() const { errors } = resposnseObj.data.tokenCreate