-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/canary'
- Loading branch information
Showing
68 changed files
with
1,220 additions
and
780 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
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,76 @@ | ||
name: Check Saleor release and update types | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 18 * * 1-5" # workdays at 18:00 | ||
|
||
jobs: | ||
check_saleor_release: | ||
name: Check Saleor release and update types | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get latest release info | ||
id: release | ||
run: | | ||
echo "Fetching latest release info..." | ||
latest_release=$(curl -s https://api.github.com/repos/saleor/saleor/releases/latest) | ||
echo "tag=$(echo $latest_release | jq -r '.tag_name')" >> "$GITHUB_OUTPUT" | ||
echo "schema_url=$(echo $latest_release | jq -r '.assets[] | select(.name == "schema.graphql") | .url')" >> "$GITHUB_OUTPUT" | ||
echo "has_schema=$(echo $latest_release | jq -e '.assets[] | select(.name == "schema.graphql") | length > 0')" >> "$GITHUB_OUTPUT" | ||
- name: Download schema.graphql | ||
run: | | ||
if [[ "${{ steps.release.outputs.has_schema }}" == "true" ]]; then | ||
echo "schema.graphql is attached to the ${{ steps.release.outputs.tag }} release, updating..." | ||
curl --output schema.graphql \ | ||
--url ${{ steps.release.outputs.schema_url }} \ | ||
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | ||
--header "Accept: application/octet-stream" \ | ||
--location | ||
else | ||
echo "schema.graphql is not attached to the ${{ steps.release.outputs.tag }} release, exiting..." | ||
exit 1 | ||
fi | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get PNPM version from package.json | ||
id: pnpm-version | ||
run: echo "pnpm_version=$(cat package.json | jq '.engines.pnpm' | sed -E 's/[^0-9.]//g')" >> $GITHUB_OUTPUT | ||
|
||
- name: Install PNPM | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ steps.pnpm-version.outputs.pnpm_version }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: package.json | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm --version && pnpm install --frozen-lockfile | ||
|
||
- name: Run `pnpm generate` | ||
id: generate-schema-from-file | ||
run: pnpm generate | ||
|
||
- name: Remove schema | ||
run: rm -f schema.graphql | ||
|
||
- name: Show changed files | ||
run: git status | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
branch: update-schema | ||
commit-message: "Update schema to Saleor ${{ steps.release.outputs.tag }}" | ||
title: "Update schema to Saleor ${{ steps.release.outputs.tag }}" | ||
body: | | ||
Pull request auto-generated by bot | ||
labels: | | ||
:robot: bot |
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,47 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { | ||
addCurrentProductToCart, | ||
clickOnNthProductElement, | ||
openCart, | ||
selectRandomAvailableVariant, | ||
} from "./utils"; | ||
|
||
test("STF_05: Checkout as a unlogged user", async ({ page }) => { | ||
await page.goto("/"); | ||
|
||
const product = await clickOnNthProductElement({ page, nth: 0 }); | ||
await selectRandomAvailableVariant({ page }); | ||
await addCurrentProductToCart({ page }); | ||
await openCart({ page }); | ||
|
||
await page.getByTestId("CheckoutLink").click(); | ||
await page.getByTestId("shippingAddressSection").waitFor(); | ||
|
||
await page.getByLabel("Email").pressSequentially("[email protected]", { delay: 50 }); | ||
await page.getByLabel("Country").selectOption("Poland"); | ||
|
||
await page.getByTestId("shippingAddressSection").waitFor(); | ||
await page.getByLabel("First name").pressSequentially("Jan", { delay: 50 }); | ||
await page.getByLabel("Last name").pressSequentially("Kowalski", { delay: 50 }); | ||
await page.getByLabel("Street address").first().pressSequentially("Ojcowska 23", { delay: 50 }); | ||
await page.getByRole("textbox", { name: "City" }).pressSequentially("Gdańsk", { delay: 50 }); | ||
await page.getByLabel("Postal code").pressSequentially("80-146", { delay: 50 }); | ||
await page.getByLabel("Postal code").blur(); | ||
|
||
await page.getByTestId("deliveryMethods").waitFor(); | ||
await page.getByLabel("DHL").click(); | ||
await page.getByLabel("DHL").blur(); | ||
|
||
await page.getByTestId("paymentMethods").waitFor(); | ||
const stripeIframe = page.getByTestId("paymentMethods").frameLocator("iframe"); | ||
await stripeIframe.getByLabel("Card number").fill("4242424242424242"); | ||
await stripeIframe.getByLabel("Expiration").fill("03/30"); | ||
await stripeIframe.getByLabel("CVC").fill("737"); | ||
await page.getByRole("button", { name: "Pay now" }).click(); | ||
|
||
await page.getByText("Thank you for placing your order.", { exact: false }).waitFor(); | ||
|
||
const summaryProductList = page.getByTestId("SummaryProductList"); | ||
await expect(summaryProductList.getByTestId("SummaryItem")).toHaveCount(1); | ||
await expect(summaryProductList).toContainText(product.name); | ||
}); |
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
Oops, something went wrong.