Skip to content

Commit

Permalink
Tags and scripts for playwright, pr-automation workflow updated (#4472)
Browse files Browse the repository at this point in the history
* new tags,scripts for playwright, pr-automation updated

* changeset updated

* changed basic-regression tag to e2e
  • Loading branch information
wojteknowacki committed Nov 20, 2023
1 parent 8eb344d commit 92d02a3
Show file tree
Hide file tree
Showing 23 changed files with 47 additions and 48 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-beans-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Tags and scripts for playwright, pr-automation workflow updated
14 changes: 6 additions & 8 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
echo "API_URI=https://${PREFIX}${GITHUB_HEAD_REF_SLUG_URL}.staging.saleor.cloud/graphql/" >> $GITHUB_OUTPUT
echo "POOL_NAME=${PREFIX}${GITHUB_HEAD_REF_SLUG_URL}" >> $GITHUB_OUTPUT
echo "POOL_INSTANCE=https://${PREFIX}${GITHUB_HEAD_REF_SLUG_URL}.staging.saleor.cloud" >> $GITHUB_OUTPUT
- name: Saleor login
uses: ./.github/actions/cli-login
with:
Expand Down Expand Up @@ -87,7 +86,7 @@ jobs:
- name: Saleor login
uses: ./.github/actions/cli-login
with:
token: ${{ secrets.STAGING_TOKEN }}
token: ${{ secrets.STAGING_TOKEN }}

- name: Instance check
id: instance_check
Expand All @@ -113,7 +112,7 @@ jobs:
if: ${{ !steps.instance_check.outputs.INSTANCE_KEY }}
env:
SALEOR_CLI_ENV: staging
BACKUP_ID: ${{ needs.prepare_variables.outputs.BACKUP_ID }}
BACKUP_ID: ${{ needs.prepare_variables.outputs.BACKUP_ID }}
INSTANCE_NAME: ${{ needs.prepare_variables.outputs.POOL_NAME }}
run: |
npx saleor env create "$INSTANCE_NAME" \
Expand Down Expand Up @@ -184,7 +183,7 @@ jobs:
AWS_TEST_DEPLOYMENT_BUCKET: ${{ secrets.AWS_TEST_DEPLOYMENT_BUCKET }}
BASE_URL: ${{ needs.prepare_variables.outputs.BASE_URL }}
run: aws s3 sync ./build/dashboard "s3://${AWS_TEST_DEPLOYMENT_BUCKET}/${BASE_URL}"

- name: Invalidate cache
env:
AWS_TEST_CF_DIST_ID: ${{ secrets.AWS_TEST_CF_DIST_ID }}
Expand All @@ -202,7 +201,6 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ needs.prepare_variables.outputs.POOL_NAME }}


deploy_storybook:
if: github.event.pull_request.head.repo.full_name == 'saleor/saleor-dashboard'
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -256,7 +254,7 @@ jobs:
AWS_TEST_DEPLOYMENT_BUCKET: ${{ secrets.AWS_TEST_DEPLOYMENT_BUCKET }}
BASE_URL: ${{ needs.prepare_variables.outputs.BASE_URL }}
run: aws s3 sync ./build/storybook "s3://${AWS_TEST_DEPLOYMENT_BUCKET}/${BASE_URL}/storybook"

- name: Invalidate cache
env:
AWS_TEST_CF_DIST_ID: ${{ secrets.AWS_TEST_CF_DIST_ID }}
Expand Down Expand Up @@ -301,7 +299,7 @@ jobs:
E2E_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }}
run: npx playwright test --shard ${{ matrix.shard }}
run: npm run qa:pw-e2e -- --shard ${{ matrix.shard }}

- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v3
Expand All @@ -312,7 +310,7 @@ jobs:
retention-days: 1

merge-reports:
if: '!cancelled()'
if: !cancelled()
needs: [run-tests]

runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@
"qa:move-videos": "find cypress/videos -type f -name \"*.js.mp4\" -exec mv {} cypress/reports/mochareports/videos \\;",
"qa:artifact-move-screenshots": "find cypress/reports/*/mochareports -type d -name \"*.js\" -exec mv {} cypress/reports/mochareports \\;",
"qa:artifact-move-videos": "find cypress/reports/*/mochareports/videos -type f -name \"*.js.mp4\" -exec mv {} cypress/reports/mochareports/videos \\;",
"qa:basic-regression": "npx playwright test --grep @basic-regression",
"qa:full-regression": "npx playwright test"
"qa:pw-e2e": "npx playwright test --grep @e2e",
"qa:pw-ui": "npx playwright test --ui"
},
"description": "![Saleor Dashboard](https://user-images.githubusercontent.com/44495184/185379472-2a204c0b-9b7a-4a3e-93c0-2cb85205ed5e.png)"
}
6 changes: 2 additions & 4 deletions playwright/tests/attributes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_34 User should be able to create Dropdown attribute, required, Product attribute @basic-regression", async ({

test("TC: SALEOR_34 User should be able to create Dropdown attribute, required, Product attribute @e2e", async ({
page,
}) => {
const configurationPage = new ConfigurationPage(page);
Expand All @@ -29,8 +28,7 @@ test("TC: SALEOR_34 User should be able to create Dropdown attribute, required,
await expect(attributesPage.valueRequiredCheckbox).toBeEnabled();
expect(await attributesPage.valueRequiredCheckbox.isChecked()).toBeTruthy();
});
test("TC: SALEOR_35 User should be able to create Plain Text attribute, not required, Product attribute @basic-regression", async ({

test("TC: SALEOR_35 User should be able to create Plain Text attribute, not required, Product attribute @e2e", async ({
page,
}) => {
const attributesPage = new AttributesPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_29 Correct information on dashboard home page @basic-regression", async ({
test("TC: SALEOR_29 Correct information on dashboard home page @e2e", async ({
page,
}) => {
const homePage = new HomePage(page);
Expand Down
4 changes: 1 addition & 3 deletions playwright/tests/orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_28 Create basic order @basic-regression @order", async ({
page,
}) => {
test("TC: SALEOR_28 Create basic order @e2e @order", async ({ page }) => {
const ordersPage = new OrdersPage(page);

await page.goto(URL_LIST.orders);
Expand Down
8 changes: 4 additions & 4 deletions playwright/tests/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_3 Create basic product with variants @basic-regression @product", async ({
test("TC: SALEOR_3 Create basic product with variants @e2e @product", async ({
page,
}) => {
const productCreateDialog = new ProductCreateDialog(page);
Expand All @@ -25,7 +25,7 @@ test("TC: SALEOR_3 Create basic product with variants @basic-regression @product
await productPage.clickSaveButton();
await productPage.expectSuccessBanner();
});
test("TC: SALEOR_5 Create basic product without variants @basic-regression @product", async ({
test("TC: SALEOR_5 Create basic product without variants @e2e @product", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand All @@ -44,7 +44,7 @@ test("TC: SALEOR_5 Create basic product without variants @basic-regression @prod
await productPage.expectSuccessBanner();
});

test("TC: SALEOR_26 Create basic info variant - via edit variant page @basic-regression @product", async ({
test("TC: SALEOR_26 Create basic info variant - via edit variant page @e2e @product", async ({
page,
}) => {
const variantName = `TC: SALEOR_26 - variant name - ${new Date().toISOString()}`;
Expand All @@ -70,7 +70,7 @@ test("TC: SALEOR_26 Create basic info variant - via edit variant page @basic-reg
}),
).toBeVisible();
});
test("TC: SALEOR_27 Create full info variant - via edit variant page @basic-regression @product", async ({
test("TC: SALEOR_27 Create full info variant - via edit variant page @e2e @product", async ({
page,
}) => {
const variantName = `TC: SALEOR_26 - variant name - ${new Date().toISOString()}`;
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/productTypes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { test } from "@playwright/test";
test.use({ storageState: "playwright/.auth/admin.json" });
const productTypeName = `e2e-product-type-${faker.datatype.number()}`;

test("TC: SALEOR_1 Create basic product type @basic-regression @product-type", async ({
test("TC: SALEOR_1 Create basic product type @e2e @product-type", async ({
page,
}) => {
const productTypePage = new ProductTypePage(page);
Expand All @@ -18,7 +18,7 @@ test("TC: SALEOR_1 Create basic product type @basic-regression @product-type", a
await productTypePage.clickSaveButton();
await productTypePage.expectSuccessBanner();
});
test("TC: SALEOR_2 Create gift card product type @basic-regression @product-type", async ({
test("TC: SALEOR_2 Create gift card product type @e2e @product-type", async ({
page,
}) => {
const productTypePage = new ProductTypePage(page);
Expand Down
6 changes: 3 additions & 3 deletions playwright/tests/shippingMethods.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_31 Create basic shipping method @shipping-method @basic-regression", async ({
test("TC: SALEOR_31 Create basic shipping method @shipping-method @e2e", async ({
page,
}) => {
const shippingMethodsPage = new ShippingMethodsPage(page);
Expand All @@ -26,7 +26,7 @@ test("TC: SALEOR_31 Create basic shipping method @shipping-method @basic-regress
await shippingMethodsPage.saveShippingZone();
await shippingMethodsPage.basePage.expectSuccessBanner();
});
test("TC: SALEOR_32 Add price rate to shipping method - with excluded zip codes adn excluded product @shipping-method @basic-regression", async ({
test("TC: SALEOR_32 Add price rate to shipping method - with excluded zip codes adn excluded product @shipping-method @e2e", async ({
page,
}) => {
const shippingMethodsPage = new ShippingMethodsPage(page);
Expand Down Expand Up @@ -55,7 +55,7 @@ test("TC: SALEOR_32 Add price rate to shipping method - with excluded zip codes
1,
);
});
test("TC: SALEOR_33 Add weight rate to shipping method - with included zip codes adn excluded product @shipping-method @basic-regression", async ({
test("TC: SALEOR_33 Add weight rate to shipping method - with included zip codes adn excluded product @shipping-method @e2e", async ({
page,
}) => {
const shippingMethodsPage = new ShippingMethodsPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/apps.json" });

test("TC: SALEOR_10 User should be able to navigate to apps list as a staff member using APP permission", async ({
test("TC: SALEOR_10 User should be able to navigate to apps list as a staff member using APP permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/singlePermissions/channelsWebhooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/channels-webhooks.json" });

test("TC: SALEOR_11 User should be able to navigate to channel list as a staff member using CHANNEL permission", async ({
test("TC: SALEOR_11 User should be able to navigate to channel list as a staff member using CHANNEL permission @e2e", async ({
page,
}) => {
const channelPage = new ChannelPage(page);
Expand All @@ -22,7 +22,7 @@ test("TC: SALEOR_11 User should be able to navigate to channel list as a staff m
await expect(channelPage.createChannelButton).toBeVisible();
await expect(channelPage.deleteChannelButton.first()).toBeVisible();
});
test("TC: SALEOR_12 User should be able to navigate to webhooks and events as a staff member using CHANNEL permission", async ({
test("TC: SALEOR_12 User should be able to navigate to webhooks and events as a staff member using CHANNEL permission @e2e", async ({
page,
}) => {
const webhooksEventsPage = new WebhooksEventsPage(page);
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/singlePermissions/contentPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/content.json" });

test("TC: SALEOR_14 User should be able to navigate to content list as a staff member using CONTENT aka PAGE permission", async ({
test("TC: SALEOR_14 User should be able to navigate to content list as a staff member using CONTENT aka PAGE permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand All @@ -21,7 +21,7 @@ test("TC: SALEOR_14 User should be able to navigate to content list as a staff m
await mainMenuPage.expectMenuItemsCount(3);
await basePage.expectGridToBeAttached();
});
test("TC: SALEOR_15 User should be able to navigate to page types list as a staff member using CONTENT aka PAGE permission", async ({
test("TC: SALEOR_15 User should be able to navigate to page types list as a staff member using CONTENT aka PAGE permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/customer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/customer.json" });

test("TC: SALEOR_13 User should be able to navigate to customer list as a staff member using CUSTOMER permission", async ({
test("TC: SALEOR_13 User should be able to navigate to customer list as a staff member using CUSTOMER permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/singlePermissions/discount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/discount.json" });

test("TC: SALEOR_6 User should be able to navigate to discount list as a staff member using DISCOUNTS permission", async ({
test("TC: SALEOR_6 User should be able to navigate to discount list as a staff member using DISCOUNTS permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand All @@ -21,7 +21,7 @@ test("TC: SALEOR_6 User should be able to navigate to discount list as a staff m
await mainMenuPage.expectMenuItemsCount(3);
});

test("TC: SALEOR_7 User should be able to navigate to voucher list as a staff member using DISCOUNTS permission", async ({
test("TC: SALEOR_7 User should be able to navigate to voucher list as a staff member using DISCOUNTS permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/singlePermissions/orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/orders.json" });

test("TC: SALEOR_8 User should be able to navigate to order list as a staff member using ORDER permission", async ({
test("TC: SALEOR_8 User should be able to navigate to order list as a staff member using ORDER permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand All @@ -20,7 +20,7 @@ test("TC: SALEOR_8 User should be able to navigate to order list as a staff memb
await basePage.expectGridToBeAttached();
await mainMenuPage.expectMenuItemsCount(3);
});
test("TC: SALEOR_9 User should be able to navigate to draft list as a staff member using ORDER permission", async ({
test("TC: SALEOR_9 User should be able to navigate to draft list as a staff member using ORDER permission @e2e", async ({
page,
}) => {
const basePage = new BasePage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/plugins.json" });

test("TC: SALEOR_16 User should be able to navigate to plugin list as a staff member using PLUGINS permission", async ({
test("TC: SALEOR_16 User should be able to navigate to plugin list as a staff member using PLUGINS permission @e2e", async ({
page,
}) => {
const configurationPage = new ConfigurationPage(page);
Expand Down
6 changes: 3 additions & 3 deletions playwright/tests/singlePermissions/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/product.json" });

test("TC: SALEOR_23 User should be able to navigate to product list as a staff member using PRODUCT permission", async ({
test("TC: SALEOR_23 User should be able to navigate to product list as a staff member using PRODUCT permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand All @@ -21,7 +21,7 @@ test("TC: SALEOR_23 User should be able to navigate to product list as a staff m
await mainMenuPage.expectMenuItemsCount(5);
await basePage.expectGridToBeAttached();
});
test("TC: SALEOR_24 User should be able to navigate to collections list as a staff member using PRODUCT permission", async ({
test("TC: SALEOR_24 User should be able to navigate to collections list as a staff member using PRODUCT permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand All @@ -34,7 +34,7 @@ test("TC: SALEOR_24 User should be able to navigate to collections list as a sta
await mainMenuPage.expectMenuItemsCount(5);
await basePage.expectGridToBeAttached();
});
test("TC: SALEOR_25 User should be able to navigate to categories list as a staff member using PRODUCT permission", async ({
test("TC: SALEOR_25 User should be able to navigate to categories list as a staff member using PRODUCT permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/productType.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/product-type.json" });

test("TC: SALEOR_17 User should be able to navigate to product type list as a staff member using PRODUCT TYPE permission", async ({
test("TC: SALEOR_17 User should be able to navigate to product type list as a staff member using PRODUCT TYPE permission @e2e", async ({
page,
}) => {
const configurationPage = new ConfigurationPage(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/settings.json" });

test("TC: SALEOR_18 User should be able to navigate to configuration as a staff member using SETTINGS permission", async ({
test("TC: SALEOR_18 User should be able to navigate to configuration as a staff member using SETTINGS permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/shipping.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/shipping.json" });

test("TC: SALEOR_21 User should be able to navigate to shipping zones page as a staff member using SHIPPING permission", async ({
test("TC: SALEOR_21 User should be able to navigate to shipping zones page as a staff member using SHIPPING permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/singlePermissions/staffMembers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/staff-member.json" });

test("TC: SALEOR_19 User should be able to navigate to staff members list page as a staff member using STAFF permission", async ({
test("TC: SALEOR_19 User should be able to navigate to staff members list page as a staff member using STAFF permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand All @@ -23,7 +23,7 @@ test("TC: SALEOR_19 User should be able to navigate to staff members list page a
await basePage.expectGridToBeAttached();
});

test("TC: SALEOR_20 User should be able to navigate to permission group list page as a staff member using STAFF permission", async ({
test("TC: SALEOR_20 User should be able to navigate to permission group list page as a staff member using STAFF permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/singlePermissions/translations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/translations.json" });

test("TC: SALEOR_22 User should be able to navigate to translations page as a staff member using TRANSLATION permission", async ({
test("TC: SALEOR_22 User should be able to navigate to translations page as a staff member using TRANSLATION permission @e2e", async ({
page,
}) => {
const mainMenuPage = new MainMenuPage(page);
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/warehouse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test } from "@playwright/test";

test.use({ storageState: "playwright/.auth/admin.json" });

test("TC: SALEOR_30 Create basic warehouse @basic-regression @warehouse", async ({
test("TC: SALEOR_30 Create basic warehouse @e2e @warehouse", async ({
page,
}) => {
const warehousePage = new WarehousePage(page);
Expand Down

0 comments on commit 92d02a3

Please sign in to comment.