diff --git a/.changeset/funny-moles-design.md b/.changeset/funny-moles-design.md new file mode 100644 index 00000000000..d6e1860bee6 --- /dev/null +++ b/.changeset/funny-moles-design.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": minor +--- + +Cypress tests are no longer possible to be executed \ No newline at end of file diff --git a/.env.template b/.env.template index 0041a4649c4..c8cbab7d31f 100644 --- a/.env.template +++ b/.env.template @@ -4,12 +4,6 @@ APPS_MARKETPLACE_API_URL=https://apps.saleor.io/api/v2/saleor-apps LOCALE_CODE="EN" DEMO_MODE=false -CYPRESS_USER_NAME=xxxx -CYPRESS_USER_PASSWORD=xxxx -CYPRESS_SECOND_USER_NAME=xxxx -CYPRESS_PERMISSIONS_USERS_PASSWORD=xxxx -CYPRESS_baseUrl=http://localhost:9000/ -CYPRESS_MAILPITURL=xxxx MAILPITURL=xxxx #For playwright E2E_USER_NAME=xxxx diff --git a/.github/actions/e2e/action.yml b/.github/actions/e2e/action.yml deleted file mode 100644 index 1b0f3db024c..00000000000 --- a/.github/actions/e2e/action.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: e2e-parallel -description: "Trigger e2e tests and create reports" -inputs: - apiUrl: - description: "API URL from PR or staging" - required: true - baseUrl: - description: "FE URL from PR or staging" - required: true - commitInfoMessage: - description: "Info displayed in commit" - required: false - cypressGrepTags: - description: "Passed tags that should be executed" - required: true - split: - description: "E2E tests containers number" - required: true - splitIndex: - description: "E2E tests container index" - required: true - install: - description: "Triggers cypress installation" - required: false - browser: - description: "Browser which e2e should test" - required: false - appMountUri: - description: "URL for Apps" - required: true - userName: - description: "Name of user which e2e uses" - required: true - secondUserName: - description: "Name of the second user which e2e uses" - required: true - userPassword: - description: "User password for e2e" - required: true - permissionsUserPassword: - description: "User with limited permissions password" - required: true - mailpitUrl: - description: "Mail provider URL" - required: true - stripeSecretKey: - description: "Payments providers secret" - required: false - stripePublicKey: - description: "Payments providers secret" - required: false -runs: - using: "composite" - steps: - - name: e2e with reports - uses: cypress-io/github-action@v6 - with: - install: ${{inputs.install}} - browser: ${{inputs.browser}} - env: - ## backward compatibility for older versions - API_URI: ${{inputs.apiUrl}} - - API_URL: ${{inputs.apiUrl}} - APP_MOUNT_URI: ${{ inputs.appMountUri }} - BASE_URL: ${{inputs.baseUrl}} - CYPRESS_USER_NAME: ${{ inputs.userName }} - CYPRESS_SECOND_USER_NAME: ${{ inputs.secondUserName }} - CYPRESS_USER_PASSWORD: ${{ inputs.userPassword }} - CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ inputs.permissionsUserPassword }} - CYPRESS_MAILPITURL: ${{ inputs.mailpitUrl }} - CYPRESS_grepTags: ${{ inputs.cypressGrepTags }} - SPLIT: ${{ inputs.split }} - SPLIT_INDEX: ${{ inputs.splitIndex}} - STRIPE_SECRET_KEY: ${{inputs.stripeSecretKey}} - STRIPE_PUBLIC_KEY: ${{inputs.stripePublicKey}} - COMMIT_INFO_MESSAGE: ${{inputs.commitInfoMessage}} - - name: Create reports dir - shell: bash - continue-on-error: true - if: ${{ ! cancelled() }} - run: npm run qa:create-artifacts-dirs - - name: Move screenshots into reports dir - shell: bash - continue-on-error: true - if: ${{ ! cancelled() }} - run: npm run qa:move-screenshots - - name: Upload reports - uses: actions/upload-artifact@v3 - if: always() - with: - name: report-${{ strategy.job-index }} - path: ./cypress/reports - retention-days: 5 - if-no-files-found: ignore diff --git a/.github/actions/testmo/testmo-threads-submit-cypress/action.yml b/.github/actions/testmo/testmo-threads-submit-cypress/action.yml deleted file mode 100644 index f92d3553d87..00000000000 --- a/.github/actions/testmo/testmo-threads-submit-cypress/action.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: submit-testmo -description: "Submits testmo resports" -inputs: - testmoUrl: - description: "Testmo project URL" - required: true - testmoToken: - description: "Testmo token" - required: true - testmoRunId: - description: "Parallelized job Testmo run id" - required: true -runs: - using: composite - steps: - - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: npm - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-qa-${{ env.cache-name }}- - ${{ runner.os }}-qa- - ${{ runner.os }}- - - name: Install Dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - shell: bash - run: NODE_OPTIONS=--max_old_space_size=4096 npm install - - name: Install dependencies - if: ${{ ! cancelled() }} - working-directory: .github/workflows - shell: bash - run: npm ci - - name: Testmo threads submit - if: github.event.pull_request.head.repo.fork == false && !cancelled() - working-directory: .github/workflows - shell: bash - run: | - npx testmo automation:run:submit-thread \ - --instance "$TESTMO_URL" \ - --run-id "$TESTMO_RUN_ID" \ - --results ../../cypress/reports/junit/*.xml - env: - TESTMO_URL: ${{ inputs.testmoUrl }} - TESTMO_TOKEN: ${{ inputs.testmoToken }} - TESTMO_RUN_ID: ${{ inputs.testmoRunId}} - - name: Download reports artifacts - uses: actions/download-artifact@v3 - with: - path: ./cypress/reports - - name: Create reports dir - continue-on-error: true - shell: bash - run: npm run qa:create-artifacts-dirs - - name: Merge report files - continue-on-error: true - shell: bash - run: npm run qa:generate-html-report - - name: Move artifacts screenshots into reports dir - continue-on-error: true - shell: bash - run: npm run qa:artifact-move-screenshots - - name: Upload reports - uses: actions/upload-artifact@v3 - if: always() - with: - name: combined-report - path: ./cypress/reports - retention-days: 5 - if-no-files-found: ignore diff --git a/.github/workflows/cypress-repeat.yml b/.github/workflows/cypress-repeat.yml deleted file mode 100644 index a9c8de07800..00000000000 --- a/.github/workflows/cypress-repeat.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Cypress repeat - -on: - workflow_dispatch: - inputs: - spec: - required: false - description: "Spec to run. Leave empty if you prefer to filter tests using grep" - grep: - required: false - description: "Run all tests which titles contain text. Leave empty if you prefer to filter tests using spec." - dashboard_url: - required: true - default: "https://automation-dashboard.staging.saleor.cloud/dashboard" - description: "Dashboard url" - API_url: - required: true - default: "https://automation-dashboard.staging.saleor.cloud/graphql/" - description: "API url" - repeat: - required: true - default: "10" - description: "How many times run tests" - -jobs: - run-tests: - if: ${{ github.event.inputs.spec }} || ${{ github.event.inputs.grep }} ## Do not run if spec or grep not provided - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - - - name: Package - run: npm ci - - - name: Install cypress-repeat - run: npm i -D cypress-repeat - - - name: Cypress run - id: cypress - uses: cypress-io/github-action@v4 - env: - ## backward compatibility for older versions - API_URI: ${{ github.event.inputs.API_url}} - - API_URL: ${{ github.event.inputs.API_url}} - APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} - BASE_URL: ${{ github.event.inputs.dashboard_url}} - CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} - CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} - CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} - CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_MAILPITURL: ${{ secrets.CYPRESS_MAILPITURL }} - COMMIT_INFO_MESSAGE: Cypress repeat with - ${{ github.event.inputs.spec }} ${{ github.event.inputs.grep }} ${{ github.event.inputs.dashboard_url}} - CYPRESS_grep: ${{ github.event.inputs.grep }} - STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} - STRIPE_PUBLIC_KEY: ${{ secrets.STRIPE_PUBLIC_KEY }} - with: - parallel: true - group: "UI - Chrome" - record: true - tag: Repeat - spec: ${{ github.event.inputs.spec }} - command: npx cypress-repeat -n ${{ github.event.inputs.repeat}} diff --git a/.github/workflows/cypressTestsHelpers/approveAndMergeReleasePR.js b/.github/workflows/cypressTestsHelpers/approveAndMergeReleasePR.js deleted file mode 100644 index 34508638f7b..00000000000 --- a/.github/workflows/cypressTestsHelpers/approveAndMergeReleasePR.js +++ /dev/null @@ -1,173 +0,0 @@ -const { Octokit } = require("@octokit/core"); -const { Command } = require("commander"); -const { GraphQLClient } = require("graphql-request"); -const { statusAndID } = require("./getTestsResults"); -const { failedTestCases } = require("./getTestsResults"); - -const program = new Command(); -const client = new GraphQLClient("https://dashboard.cypress.io/graphql"); - -const repo = "saleor-cloud-deployments"; -const owner = "saleor"; - -program - .name("Approve PR") - .description("Approve and merge PR if patch release") - .option("--version ", "version of a project") - .option("--pull_request_number ", "Pull Request number") - .option("--auto_release", "is auto release") - .option("--dashboard_url ", "Cypress dashboard url") - .action(async options => { - const octokit = new Octokit({ - auth: process.env.GITHUB_TOKEN, - }); - - const pullNumber = options.pull_request_number; - - const pullRequest = await octokit.request( - "GET /repos/{owner}/{repo}/pulls/{pull_number}", - { - owner, - repo, - pull_number: pullNumber, - }, - ); - - const commitId = pullRequest.data.merge_commit_sha; - - const data = await statusAndID(options.dashboard_url); - - let testsStatus = data.status; - - let requestBody = `Cypress tests passed. See results at ${options.dashboard_url}`; - - if (testsStatus === "FAILED") { - const failedNewTests = []; - const listOfTestIssues = await getListOfTestsIssues(octokit); - const testCases = await failedTestCases(data.runId); - testCases.forEach(testCase => { - if (testCase.titleParts) { - const issue = issueOnGithub(listOfTestIssues, testCase.titleParts[1]); - if (issue) { - const knownBug = isIssueAKnownBugForReleaseVersion( - issue, - options.version, - ); - if (!knownBug) { - failedNewTests.push({ - title: testCase.titleParts[1], - url: issue.html_url, - spec: testCase.titleParts[0], - }); - } - } else { - failedNewTests.push({ - title: testCase.titleParts[1], - spec: testCase.titleParts[0], - }); - } - } - }); - - if (failedNewTests.length === 0) { - requestBody = `All failed tests are known bugs, can be merged. See results at ${options.dashboard_url}`; - testsStatus = "PASSED"; - } else if (failedNewTests.length > 10) { - //If there are more than 10 new bugs it's probably caused by something else. Server responses with 500, or test user was deleted, etc. - - requestBody = - "There is more than 10 new bugs, check results manually and create issues for them if necessary"; - } else { - requestBody = `New bugs found, results at: ${options.dashboard_url}. List of issues to check: `; - for (const newBug of failedNewTests) { - if (!newBug.url) { - requestBody += `\n${newBug.title}`; - } else { - requestBody += `\n${newBug.title} - ${newBug.url}`; - } - } - requestBody += `\nIf this bugs won't be fixed in next patch release for this version mark them as known issues`; - } - } else if (testsStatus === "ERRORED") { - requestBody = `Tests ERRORED! Check log at ${options.dashboard_url}`; - } - - const event = "COMMENT"; - - await octokit.request( - "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews", - { - owner, - repo, - pull_number: pullNumber, - commit_id: commitId, - body: requestBody, - event, - comments: [], - }, - ); - - if ( - options.auto_release && - isPatchRelease(options.version) && - testsStatus === "PASSED" - ) { - await octokit.request( - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge", - { - owner, - repo, - pull_number: pullNumber, - merge_method: "squash", - }, - ); - } - }) - .parse(); - -function isPatchRelease(version) { - const regex = /\d+\.\d+\.[1-9]/; - return version.match(regex) ? true : false; -} - -async function getListOfTestsIssues(octokit) { - const result = await octokit.request( - "GET /repos/{owner}/saleor-dashboard/issues?labels=tests", - { - owner, - }, - ); - return result.data; -} - -function issueOnGithub(listOfTestIssues, testCaseTitle) { - if (listOfTestIssues.length > 0) { - return listOfTestIssues.find(issue => { - return issue.title.includes(testCaseTitle); - }); - } -} - -function isIssueAKnownBugForReleaseVersion(issue, releaseVersion) { - const issueBody = issue.body; - const regex = /Known bug for versions:([\s\S]*)Additional/; - const lines = issueBody.match(regex)[1].split("\n"); - const lineContainReleaseVersionRegex = /v(\d{2,3}).*(true|false)/; - const releaseVersionLine = lines.find(line => { - if (line.match(lineContainReleaseVersionRegex)) { - const version = line.match(lineContainReleaseVersionRegex)[1]; - if (version === getFormattedVersion(releaseVersion)) { - return line; - } - } - }); - const knownBugOnReleaseVersion = releaseVersionLine - ? releaseVersionLine.match(lineContainReleaseVersionRegex)[2] - : false; - return knownBugOnReleaseVersion === "true" ? true : false; -} - -function getFormattedVersion(version) { - const regex = /^\d+\.\d+\./; - return version.match(regex)[0].replace(/\./g, ""); -} diff --git a/.github/workflows/cypressTestsHelpers/getFailedTests.js b/.github/workflows/cypressTestsHelpers/getFailedTests.js deleted file mode 100644 index 4ee99956426..00000000000 --- a/.github/workflows/cypressTestsHelpers/getFailedTests.js +++ /dev/null @@ -1,26 +0,0 @@ -const core = require("@actions/core"); -const { Command } = require("commander"); -const { statusAndID } = require("./getTestsResults"); -const { failedTestCases } = require("./getTestsResults"); - -const program = new Command(); - -program - .name("Get failed test") - .description("Get info if notify on slack if tests failed") - .option("--dashboard_url ", "Cypress dashboard url") - .action(async options => { - const data = await statusAndID(options.dashboard_url); - - let testsStatus = data.status; - - if (testsStatus === "FAILED") { - const testCases = await failedTestCases(data.runId); - if (testCases.length >= 20) { - core.setOutput("notifySlack", "true"); - } - } else if (testsStatus === "FAILED") { - core.setOutput("notifySlack", "true"); - } - }) - .parse(); diff --git a/.github/workflows/cypressTestsHelpers/getTestsResults.js b/.github/workflows/cypressTestsHelpers/getTestsResults.js deleted file mode 100644 index 194870c636c..00000000000 --- a/.github/workflows/cypressTestsHelpers/getTestsResults.js +++ /dev/null @@ -1,79 +0,0 @@ -const { Command } = require("commander"); -const { GraphQLClient } = require("graphql-request"); - -const program = new Command(); -const client = new GraphQLClient("https://dashboard.cypress.io/graphql"); - -const statusAndID = dashboardUrl => getTestsStatusAndId(dashboardUrl); -const failedTestCases = runId => getFailedTestCases(runId); - -async function getTestsStatusAndId(dashboardUrl) { - const getProjectRegex = /\/projects\/([^\/]*)/; - const getRunRegex = /\/runs\/([^\/]*)/; - const requestVariables = { - projectId: dashboardUrl.match(getProjectRegex)[1], - buildNumber: dashboardUrl.match(getRunRegex)[1], - }; - - const throwErrorAfterTimeout = setTimeout(function () { - throw new Error("Run have still running status, after all tests executed"); - }, 1200000); - - const data = await waitForTestsToFinish(requestVariables); - - clearTimeout(throwErrorAfterTimeout); - return { status: data.status, runId: data.id }; -} - -async function waitForTestsToFinish(requestVariables) { - return new Promise((resolve, reject) => { - client - .request( - `query ($projectId: String!, $buildNumber: ID!) { - runByBuildNumber(buildNumber: $buildNumber, projectId: $projectId) { - status, - id - } - }`, - requestVariables, - ) - .then(response => { - if (response.runByBuildNumber.status === "RUNNING") { - setTimeout(async function () { - resolve(await waitForTestsToFinish(requestVariables)); - }, 10000); - } else { - resolve(response.runByBuildNumber); - } - }); - }); -} - -async function getFailedTestCases(runId) { - const requestVariables = { - input: { - runId, - testResultState: ["FAILED"], - }, - }; - - return new Promise((resolve, reject) => { - client - .request( - `query RunTestResults($input: TestResultsTableInput!) { - testResults(input: $input) { - ... on TestResult { - ...RunTestResult - } - } - } - fragment RunTestResult on TestResult { id titleParts state}`, - requestVariables, - ) - .then(response => { - resolve(response.testResults); - }); - }); -} - -module.exports = { statusAndID, failedTestCases }; diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index e21ab50bc63..00000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,149 +0,0 @@ -name: E2E - -on: - pull_request: - types: [edited, labeled] - -jobs: - get-selected-tags-and-containers: - if: ${{ contains(github.event.pull_request.labels.*.name, 'run e2e') }} - runs-on: ubuntu-latest - outputs: - tags: ${{steps.get_tags.outputs.result}} - containers: ${{ steps.get_containers.outputs.result}} - - steps: - - name: Get tags - id: get_tags - uses: actions/github-script@v6 - env: - pullRequestBody: ${{ github.event.pull_request.body }} - with: - result-encoding: string - script: | - const { pullRequestBody } = process.env - const tags = ["@critical"]; - try{ - const removedPullRequestBodyBeforeTests = pullRequestBody.split(`### Do you want to run more stable tests?`); - const removedPullRequestBodyAfterTests = removedPullRequestBodyBeforeTests[1].split(`CONTAINERS`); - let tagsInString = removedPullRequestBodyAfterTests[0]; - tagsInString = tagsInString.split('\n'); - tagsInString.forEach(line => { - if (line.includes('[x]')) tags.push(line.replace(/[0-9]+\. \[x\] /, "@stable+@")) - }); - const tagsToReturn = tags.join(",").toString(); - return tagsToReturn.replace(/\r/g, '') - }catch{ - return '@critical' - } - - name: get-containers - id: get_containers - uses: actions/github-script@v6 - env: - pullRequestBody: ${{ github.event.pull_request.body }} - with: - script: | - const { pullRequestBody } = process.env - const containers = []; - const numberOfContainersRegex = /CONTAINERS=(\d*)/ - const numberOfContainers = pullRequestBody.match(numberOfContainersRegex); - for(let i=1; i<=numberOfContainers[1]; i++){ - containers.push(i) - } - return {"containers": containers} - install-cypress: - needs: get-selected-tags-and-containers - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - - - name: Wait for Deploy and tests - uses: lewagon/wait-on-check-action@v1.0.0 - with: - ref: ${{ github.event.pull_request.head.sha }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - running-workflow-name: e2e - check-name: deploy - wait-interval: 10 - - - name: Cypress install - uses: cypress-io/github-action@v4 - with: - # Disable running of tests within install job - runTests: false - - run-tests-in-parallel-on-label: - needs: [get-selected-tags-and-containers, install-cypress] - runs-on: ubuntu-latest - env: - NODE_OPTIONS: "--max_old_space_size=4096" - container: cypress/browsers:node18.12.0-chrome106-ff106 - strategy: - fail-fast: false - max-parallel: 10 - matrix: - ${{ fromJson(needs.get-selected-tags-and-containers.outputs.containers) }} - # run copies of the current job in parallel - steps: - - uses: rlespinasse/github-slug-action@3.1.0 - - - name: Set domain - id: set-domain - run: | - echo "domain=${{ env.GITHUB_HEAD_REF_SLUG_URL }}.dashboard.saleor.rocks" >> $GITHUB_OUTPUT - - ## backward compatibility for older versions - - name: Get API_URI - id: api_uri - # Search for API_URI in PR description and use default if not defined - env: - pull_request_body: ${{ github.event.pull_request.body }} - prefix: API_URI= - pattern: (http|https)://[a-zA-Z0-9.-]+/graphql/? - fallback_uri: ${{ secrets.CYPRESS_API_URI }} - run: | - echo "custom_api_uri=$(echo "$pull_request_body" | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1 | { read custom_uri; if [ -z "$custom_uri" ]; then echo "$fallback_uri"; else echo "$custom_uri"; fi })" >> $GITHUB_OUTPUT - - - name: Get API_URL - id: api_url - env: - pull_request_body: ${{ github.event.pull_request.body }} - prefix: API_URL= - pattern: (http|https)://[a-zA-Z0-9.-]+/graphql/? - fallback_uri: ${{ secrets.CYPRESS_API_URL }} - run: | - echo "custom_api_url=$(echo "$pull_request_body" | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1 | { read custom_url; if [ -z "$custom_url" ]; then echo "$fallback_url"; else echo "$custom_url"; fi })" >> $GITHUB_OUTPUT - - - - name: Checkout - uses: actions/checkout@v2 - - - name: Cypress run - uses: cypress-io/github-action@v4 - env: - ## backward compatibility for older versions - API_URI: ${{ steps.api_uri.outputs.custom_api_uri }} - - API_URL: ${{ steps.api_url.outputs.custom_api_url }} - APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} - BASE_URL: https://${{ steps.set-domain.outputs.domain }}/ - CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} - CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} - CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} - CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - CYPRESS_mailHogUrl: ${{ secrets.CYPRESS_MAILHOG }} - COMMIT_INFO_MESSAGE: ${{ needs.get-selected-tags-and-containers.outputs.tags }} tests triggered on PR - https://github.com/${{ github.repository }}/pull/${{ github.ref_name }} - CYPRESS_grepTags: ${{ needs.get-selected-tags-and-containers.outputs.tags }} - CYPRESS_MAILPITURL: ${{ secrets.CYPRESS_MAILPITURL }} - with: - parallel: true - group: "UI - Chrome" - record: true - tag: e2eTestsOnPR diff --git a/.gitignore b/.gitignore index 14bc37bb69a..7ff7cb5621e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,16 +38,12 @@ node_modules/ /static/ /videos/ /screenshots/ -cypress/screenshots -cypress/videos /results/ /testmo/ /saleor/static/assets/ webpack-bundle.json /templates/templated_email/compiled/* !/templates/templated_email/compiled/.gitkeep -cypress/reports -cypress/TestResults mochawesome.json # Exported results file django-queries-results.html diff --git a/cypress.config.js b/cypress.config.js deleted file mode 100644 index a7a6a49ebdb..00000000000 --- a/cypress.config.js +++ /dev/null @@ -1,51 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable no-console */ -const { defineConfig } = require("cypress"); -const fs = require("fs"); -const cypressSplit = require("cypress-split"); - -module.exports = defineConfig({ - projectId: "51ef7c", - chromeWebSecurity: false, - defaultCommandTimeout: 20000, - requestTimeout: 20000, - viewportWidth: 1400, - viewportHeight: 660, - screenshotsFolder: "cypress/reports/mochareports", - screenshotOnRunFailure: true, - experimentalMemoryManagement: true, - numTestsKeptInMemory: 8, - retries: { - runMode: 2, - openMode: 0, - }, - reporter: "cypress-multi-reporters", - reporterOptions: { - configFile: "reporter-config.json", - }, - e2e: { - env: { - grepFilterSpecs: true, - grepOmitFiltered: true, - }, - baseUrl: process.env.BASE_URL, - async setupNodeEvents(on, config) { - config = require("./cypress/support/cypress-grep/plugin")(config); - config = await require("./cypress/plugins/index.js")(on, config); - cypressSplit(on, config); - on("after:spec", (spec, results) => { - if (results && results.video) { - return fs.unlink(results.video, function (err) { - if (err) { - console.warn(`Could not remove video - ${err}`); - } else { - console.log("File removed:", results.video); - } - }); - } - }); - return config; - }, - specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}", - }, -}); diff --git a/cypress/e2e/apps.js b/cypress/e2e/apps.js deleted file mode 100644 index 274890f09fa..00000000000 --- a/cypress/e2e/apps.js +++ /dev/null @@ -1,254 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { APP_DETAILS } from "../elements/apps/appDetails"; -import { APPS_LIST_SELECTORS } from "../elements/apps/appsList"; -import { WEBHOOK_DETAILS } from "../elements/apps/webhookDetails"; -import { BUTTON_SELECTORS } from "../elements/shared/button-selectors"; -import { appDetailsUrl, urlList } from "../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../fixtures/users"; -import { createApp, getApp, updateApp } from "../support/api/requests/Apps"; -import { - addShippingMethod, - createCheckout, - orderCreateFromCheckout, -} from "../support/api/requests/Checkout"; -import { createVoucher } from "../support/api/requests/Discounts/Vouchers"; -import { createGiftCard } from "../support/api/requests/GiftCard"; -import { getDefaultChannel } from "../support/api/utils/channelsUtils"; -import { getShippingMethodIdFromCheckout } from "../support/api/utils/ordersUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../support/api/utils/products/productsUtils"; -import { createShipping } from "../support/api/utils/shippingUtils"; -import { discountOptions } from "../support/pages/discounts/vouchersPage"; - -describe("As a staff user I want to manage apps", () => { - const startsWith = "Apps-"; - const name = `${startsWith}${faker.datatype.number()}`; - const productSlug = name + faker.datatype.number(); - - let createdApp; - let defaultChannel; - let address; - let warehouse; - let shippingMethod; - let variantsList; - let checkout; - const email = `example@example.com`; - - before(() => { - cy.loginUserViaRequest(); - - createApp(name, "MANAGE_APPS").then(app => { - createdApp = app; - }); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createShipping({ - channelId: defaultChannel.id, - name, - address, - price: 10, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - }, - ); - createTypeAttributeAndCategoryForProduct({ name }) - .then(({ productType, attribute, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - slug: productSlug, - }); - }) - .then(({ variantsList: variants }) => { - variantsList = variants; - cy.checkIfDataAreNotNull({ - createdApp, - defaultChannel, - address, - warehouse, - shippingMethod, - variantsList, - checkout, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.app); - }); - - it( - "should be able to create app. TC: SALEOR_3001", - { tags: ["@app", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const randomAppName = `${startsWith}${faker.datatype.number()}`; - - cy.visit(urlList.webhooksAndEvents) - .get(APPS_LIST_SELECTORS.createLocalAppButton) - .click() - .get(APP_DETAILS.nameInput) - .type(randomAppName) - .get(APP_DETAILS.manageAppsPermissionCheckbox) - .click() - .addAliasToGraphRequest("AppCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@AppCreate") - .its("response.body.data.appCreate.app") - .then(app => { - getApp(app.id); - }) - .then(app => { - expect(app.name).to.eq(randomAppName); - const token = app.tokens.find(element => element.name === "Default"); - expect(token).to.be.ok; - }); - }, - ); - - it( - "should be able to create webhook. TC: SALEOR_3002", - { tags: ["@app", "@allEnv", "@stable"] }, - () => { - const randomWebhookName = `${startsWith}${faker.datatype.number()}`; - const targetUrl = `http://example.${randomWebhookName}`; - - cy.visit(appDetailsUrl(createdApp.app.id)) - .get(APP_DETAILS.createWebhookButton) - .click() - .get(WEBHOOK_DETAILS.nameInput) - .type(randomWebhookName) - .get(WEBHOOK_DETAILS.targetUrlInput) - .type(targetUrl); - cy.get(WEBHOOK_DETAILS.webhookObjects).first().click(); - cy.get(WEBHOOK_DETAILS.webhookEventsCheckboxes) - .first() - .click() - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - getApp(createdApp.app.id).then(({ webhooks }) => { - expect(webhooks[0].name).to.eq(randomWebhookName); - expect(webhooks[0].targetUrl).to.eq(targetUrl); - }); - }, - ); - - it( - "should be able to create token. TC: SALEOR_3003", - { tags: ["@app", "@allEnv", "@stable"] }, - () => { - const randomTokenName = `${startsWith}${faker.datatype.number()}`; - let expectedToken; - - cy.visit(appDetailsUrl(createdApp.app.id)) - .get(APP_DETAILS.createTokenButton) - .click() - .get(APP_DETAILS.createTokenForm.tokenDialog) - .find(APP_DETAILS.createTokenForm.nameInput) - .type(randomTokenName) - .get(BUTTON_SELECTORS.submit) - .click() - .get(APP_DETAILS.createTokenForm.tokenToCopy) - .invoke("text") - .then(text => { - expectedToken = text; - cy.get(APP_DETAILS.createTokenForm.doneButton).click(); - getApp(createdApp.app.id); - }) - .then(app => { - const token = app.tokens.find( - element => element.name === randomTokenName, - ); - const tokenLastFourDigits = expectedToken.slice( - expectedToken.length - 4, - ); - expect(token.authToken).to.eq(tokenLastFourDigits); - }); - }, - ); - - it( - "should be able to use app only to manage giftCards. TC: SALEOR_3004", - { tags: ["@app", "@allEnv", "@stable"] }, - () => { - const startsWith = "AppPermission-"; - const token = createdApp.authToken; - const voucherData = { - voucherCode: `${startsWith}${faker.datatype.number()}`, - voucherValue: 10, - discountOption: discountOptions.PERCENTAGE, - channelName: defaultChannel.name, - }; - const giftCardData = { - tag: `${startsWith}${faker.datatype.number()}`, - amount: 150, - currency: "USD", - }; - - cy.clearSessionData().loginUserViaRequest(); - updateApp(createdApp.app.id, "MANAGE_GIFT_CARD"); - cy.clearSessionData(); - - createVoucher(voucherData, token).then(resp => { - expect(resp.voucherCreate).to.be.null; - }); - createGiftCard(giftCardData, token).then(resp => { - expect(resp.code).to.be.not.empty; - expect(resp.isActive).to.eq(true); - }); - }, - ); - - it( - "should be able to use app to create order from checkout. TC: SALEOR_3005", - { tags: ["@app", "@allEnv", "@stable"] }, - () => { - const token = createdApp.authToken; - - cy.clearSessionData().loginUserViaRequest(); - updateApp(createdApp.app.id, "HANDLE_CHECKOUTS"); - - cy.clearSessionData(); - - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList, - address, - billingAddress: address, - auth: "token", - }).then(({ checkout: checkoutResp }) => { - const shippingMethodId = getShippingMethodIdFromCheckout( - checkoutResp, - shippingMethod.name, - ); - checkout = checkoutResp; - addShippingMethod(checkout.id, shippingMethodId); - orderCreateFromCheckout(checkout.id, token).then(resp => { - expect(resp.id).to.be.not.empty; - }); - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/categories.js b/cypress/e2e/catalog/categories.js deleted file mode 100644 index 83aaba94841..00000000000 --- a/cypress/e2e/catalog/categories.js +++ /dev/null @@ -1,291 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { CATEGORIES_LIST_SELECTORS } from "../../elements/catalog/categories/categories-list"; -import { CATEGORY_DETAILS_SELECTORS } from "../../elements/catalog/categories/category-details"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { categoryDetailsUrl, urlList } from "../../fixtures/urlList"; -import { - createCategory as createCategoryRequest, - getCategory, -} from "../../support/api/requests/Category"; -import * as channelsUtils from "../../support/api/utils/channelsUtils"; -import * as productsUtils from "../../support/api/utils/products/productsUtils"; -import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas"; -import { - createCategory, - updateCategory, -} from "../../support/pages/catalog/categoriesPage"; - -describe("As an admin I want to manage categories", () => { - const startsWith = "CyCategories"; - const name = `${startsWith}${faker.datatype.number()}`; - - let attribute; - let category; - let productType; - let product; - - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - productsUtils.createTypeAttributeAndCategoryForProduct({ name }); - }) - .then( - ({ - category: categoryResp, - attribute: attributeResp, - productType: productTypeResp, - }) => { - category = categoryResp; - attribute = attributeResp; - productType = productTypeResp; - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }); - }, - ) - .then(({ product: productResp }) => { - product = productResp; - cy.checkIfDataAreNotNull({ - attribute, - category, - productType, - product, - defaultChannel, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to create category. TC: SALEOR_0201", - { tags: ["@category", "@allEnv", "@oldRelease"] }, - () => { - const categoryName = `${startsWith}${faker.datatype.number()}`; - - cy.visit(urlList.categories) - .get(CATEGORIES_LIST_SELECTORS.addCategoryButton) - .click(); - createCategory({ name: categoryName, description: categoryName }) - .its("response.body.data.categoryCreate.category") - .then(newCategory => { - getCategory(newCategory.id); - }) - .then(newCategory => { - expect(newCategory.name).to.eq(categoryName); - const descriptionResp = JSON.parse(newCategory.description); - expect(descriptionResp.blocks[0].data.text).to.eq(categoryName); - }); - }, - ); - - it( - "should be able to create category as subcategory. TC: SALEOR_0202", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - const categoryName = `${startsWith}${faker.datatype.number()}`; - - cy.visit(categoryDetailsUrl(category.id)) - .get(CATEGORY_DETAILS_SELECTORS.createSubcategoryButton) - .click(); - createCategory({ name: categoryName, description: categoryName }) - .visit(categoryDetailsUrl(category.id)) - .get(SHARED_ELEMENTS.dataGridTable) - .scrollIntoView(); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - - cy.contains(SHARED_ELEMENTS.dataGridTable, categoryName).should( - "be.visible", - ); - getCategory(category.id).then(categoryResp => { - expect(categoryResp.children.edges[0].node.name).to.eq(categoryName); - }); - }, - ); - - it( - "should be able to add product to category. TC: SALEOR_0203", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - cy.visit(categoryDetailsUrl(category.id)) - .get(CATEGORY_DETAILS_SELECTORS.productsTab) - .click() - .get(CATEGORY_DETAILS_SELECTORS.addProducts) - .click() - .url() - .should("include", urlList.addProduct); - }, - ); - - it( - "should be able to remove product from category. TC: SALEOR_0204", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("productBulkDelete"); - cy.visit(categoryDetailsUrl(category.id)) - .get(CATEGORY_DETAILS_SELECTORS.productsTab) - .click(); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.contains(SHARED_ELEMENTS.dataGridTable, product.name).should( - "be.visible", - ); - // selects first row - cy.clickGridCell(0, 0); - cy.get(CATEGORY_DETAILS_SELECTORS.deleteCategoriesButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .confirmationMessageShouldDisappear(); - cy.contains(SHARED_ELEMENTS.dataGridTable, product.name) - .should("not.exist") - .waitForRequestAndCheckIfNoErrors("@productBulkDelete"); - getCategory(category.id).then(categoryResp => { - expect(categoryResp.products.edges.length).to.be.eq(0); - }); - }, - ); - - it( - "should be able to enter category details page. TC: SALEOR_0205", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - cy.visit(urlList.categories) - .get(SHARED_ELEMENTS.searchInput) - .type(category.name); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.contains(SHARED_ELEMENTS.dataGridTable, category.name).should( - "be.visible", - ); - // opens first row details - cy.clickGridCell(1, 0); - cy.contains(SHARED_ELEMENTS.header, category.name).should("be.visible"); - }, - ); - - it( - "should be able to delete category. TC: SALEOR_0206", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - const categoryName = `${startsWith}${faker.datatype.number()}`; - cy.addAliasToGraphRequest("CategoryDelete"); - - createCategoryRequest({ - name: categoryName, - }).then(categoryResp => { - cy.visit(categoryDetailsUrl(categoryResp.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@CategoryDelete"); - getCategory(categoryResp.id).should("be.null"); - }); - }, - ); - - it( - "should be able to update category. TC: SALEOR_0207", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - const categoryName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}updatedCategory`; - - createCategoryRequest({ - name: categoryName, - }) - .then(categoryResp => { - cy.visitAndWaitForProgressBarToDisappear( - categoryDetailsUrl(categoryResp.id), - ); - updateCategory({ name: updatedName, description: updatedName }); - getCategory(categoryResp.id); - }) - .then(categoryResp => { - expect(categoryResp.name).to.eq(updatedName); - const descriptionJson = JSON.parse(categoryResp.description); - const descriptionText = descriptionJson.blocks[0].data.text; - expect(descriptionText).to.eq(updatedName); - }); - }, - ); - - it( - "should be able to delete several categories on categories list page. TC: SALEOR_0209", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - const firstCategoryName = `${startsWith}${faker.datatype.number()}`; - const secondCategoryName = `${startsWith}${faker.datatype.number()}`; - cy.addAliasToGraphRequest("CategoryBulkDelete"); - - createCategoryRequest({ - name: firstCategoryName, - }); - createCategoryRequest({ - name: secondCategoryName, - }).then(() => { - cy.visit(urlList.categories).searchInTable(startsWith); - cy.deleteTwoFirstRecordsFromGridListAndValidate("CategoryBulkDelete"); - }); - }, - ); - - it( - "should be able to remove subcategory from category. TC: SALEOR_0208", - { tags: ["@category", "@allEnv", "@stable"] }, - () => { - const subCategoryName = `${startsWith}${faker.datatype.number()}`; - const mainCategoryName = `${startsWith}${faker.datatype.number()}`; - let subCategory; - let mainCategory; - cy.addAliasToGraphRequest("CategoryBulkDelete"); - - createCategoryRequest({ - name: mainCategoryName, - }) - .then(categoryResp => { - mainCategory = categoryResp; - createCategoryRequest({ - name: subCategoryName, - parent: mainCategory.id, - }); - }) - .then(categoryResp => { - subCategory = categoryResp; - cy.visit(categoryDetailsUrl(mainCategory.id)) - .get(SHARED_ELEMENTS.dataGridTable) - .scrollIntoView(); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - // selects first row of subcategories - cy.clickGridCell(0, 0); - cy.get(CATEGORY_DETAILS_SELECTORS.deleteCategoriesButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@CategoryBulkDelete"); - getCategory(subCategory.id).should("be.null"); - getCategory(mainCategory.id); - }) - .then(categoryResp => { - expect(categoryResp.children.edges).to.be.empty; - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/collections.js b/cypress/e2e/catalog/collections.js deleted file mode 100644 index 8af8d8d1f12..00000000000 --- a/cypress/e2e/catalog/collections.js +++ /dev/null @@ -1,388 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { BUTTON_SELECTORS } from "../../elements"; -import { - collectionDetailsUrl, - urlList, -} from "../../fixtures/urlList"; -import { createChannel } from "../../support/api/requests/Channels"; -import { - addChannelToCollection, - addProductToCollection, - createCollection as createCollectionRequest, -} from "../../support/api/requests/Collections"; -import { updateChannelInProduct } from "../../support/api/requests/Product"; -import { - getCollection, -} from "../../support/api/requests/storeFront/Collections"; -import { - getProductDetails, -} from "../../support/api/requests/storeFront/ProductDetails"; -import { searchInShop } from "../../support/api/requests/storeFront/Search"; -import * as channelsUtils from "../../support/api/utils/channelsUtils"; -import * as productsUtils from "../../support/api/utils/products/productsUtils"; -import { - assignProductsToCollection, - createCollection, - removeProductsFromCollection, - updateCollection, -} from "../../support/pages/catalog/collectionsPage"; - -describe("As an admin I want to manage collections.", () => { - const startsWith = "CyCollections-"; - const productName = `${startsWith}${Date.now()}`; - - let attribute; - let productType; - let category; - let product; - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: productName, - }); - }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - attribute = attributeResp; - productType = productTypeResp; - category = categoryResp; - productsUtils.createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }); - }, - ) - .then(({ product: productResp }) => { - product = productResp; - cy.checkIfDataAreNotNull({ - attribute, - category, - productType, - product, - defaultChannel, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create hidden collection. TC: SALEOR_0301", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - - cy.visit(urlList.collections); - createCollection(collectionName, false, defaultChannel).then( - collectionResp => { - collection = collectionResp; - - assignProductsToCollection(productName); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.channelListings.0.isPublished") - .should("eq", false); - }, - ); - }, - ); - - it( - "should create published collection. TC: SALEOR_0302", - { tags: ["@collection", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - - cy.visit(urlList.collections); - createCollection(collectionName, true, defaultChannel).then( - collectionResp => { - collection = collectionResp; - - assignProductsToCollection(productName); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.channelListings.0.isPublished") - .should("eq", true); - }, - ); - }, - ); - - it( - "should create collection not available for channel. TC: SALEOR_0303", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - let channel; - - createChannel({ name: collectionName }).then(channelResp => { - channel = channelResp; - - updateChannelInProduct(product.id, channel.id); - cy.visit(urlList.collections); - createCollection(collectionName, false, channel).then( - collectionResp => { - collection = collectionResp; - - assignProductsToCollection(productName); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection") - .should("be.null"); - }, - ); - }); - }, - ); - - it( - "should create published collection with products hidden in listings. TC: SALEOR_0304", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - // Products "hidden in listings" are not displayed in Category listings or search results, - // but are listed on Collections - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - let createdProduct; - - productsUtils - .createProductInChannel({ - name: collectionName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false, - }) - .then(({ product: productResp }) => (createdProduct = productResp)); - - cy.visit(urlList.collections); - createCollection(collectionName, true, defaultChannel).then( - collectionResp => { - collection = collectionResp; - - assignProductsToCollection(collectionName); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.products.edges.0.node.id") - .should("eq", createdProduct.id); - searchInShop(createdProduct.name) - .its("body.data.products.edges") - .should("be.empty"); - }, - ); - }, - ); - - it( - "should delete collection. TC: SALEOR_0305", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - - createCollectionRequest(collectionName).then(collectionResp => { - cy.visit(collectionDetailsUrl(collectionResp.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("RemoveCollection") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@RemoveCollection"); - getCollection({ collectionId: collectionResp.id }) - .its("collection") - .should("be.null"); - }); - }, - ); - - it( - "should update collection. TC: SALEOR_0306", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}updatedCollection`; - - let collection; - - createCollectionRequest(collectionName).then(collectionResp => { - collection = collectionResp; - - cy.visitAndWaitForProgressBarToDisappear( - collectionDetailsUrl(collection.id), - ); - addChannelToCollection({ - collectionId: collection.id, - channelId: defaultChannel.id, - }); - updateCollection({ name: updatedName, description: updatedName }); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection") - .should("include", { name: updatedName }) - .its("description") - .should("have.string", `{"text": "${updatedName}"}`); - }); - }, - ); - - it( - "should assign product to collection. TC: SALEOR_0307", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `Assign-${startsWith}${faker.datatype.number()}`; - const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; - - let collection; - let productToAssign; - - createCollectionRequest(collectionName).then(collectionResp => { - collection = collectionResp; - - addChannelToCollection({ - collectionId: collection.id, - channelId: defaultChannel.id, - }); - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false, - }) - .then(({ product: productResp }) => { - productToAssign = productResp; - - cy.visitAndWaitForProgressBarToDisappear( - collectionDetailsUrl(collection.id), - ); - cy.reload(); - assignProductsToCollection(productToAssign.name); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.products.edges.0.node.id") - .should("include", productToAssign.id); - }); - }); - }, - ); - - it( - "should remove product from collection. TC: SALEOR_0308", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const collectionName = `Remove-With-Assigned-Product-${startsWith}${faker.datatype.number()}`; - const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; - let collection; - let productToAssign; - - createCollectionRequest(collectionName).then(collectionResp => { - collection = collectionResp; - - addChannelToCollection({ - collectionId: collection.id, - channelId: defaultChannel.id, - }); - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false, - }) - .then(({ product: productResp }) => { - productToAssign = productResp; - - addProductToCollection({ - collectionId: collection.id, - productId: productToAssign.id, - }); - cy.visitAndWaitForProgressBarToDisappear( - collectionDetailsUrl(collection.id), - ); - getProductDetails(productToAssign.id, defaultChannel.slug) - .its("body.data.product.collections") - .should("have.length", 1); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.products.edges") - .should("have.length", 1); - removeProductsFromCollection(productToAssign.name); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug, - }) - .its("collection.products.edges") - .should("be.empty"); - }); - }); - }, - ); - - it( - "delete several collections on collections list page. TC: SALEOR_0309", - { tags: ["@collection", "@allEnv", "@stable"] }, - () => { - const deleteSeveral = "delete-several-"; - const firstCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; - const secondCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; - let firstCollection; - let secondCollection; - cy.addAliasToGraphRequest("CollectionBulkDelete"); - createCollectionRequest(firstCollectionName).then(collectionResp => { - firstCollection = collectionResp; - }); - createCollectionRequest(secondCollectionName).then(collectionResp => { - secondCollection = collectionResp; - cy.visit(urlList.collections); - cy.deleteTwoFirstRecordsFromGridListAndValidate("CollectionBulkDelete"); - getCollection({ collectionId: firstCollection.id }) - .its("collection") - .should("be.null"); - getCollection({ collectionId: secondCollection.id }) - .its("collection") - .should("be.null"); - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/giftCards/activateGiftCards.js b/cypress/e2e/catalog/giftCards/activateGiftCards.js deleted file mode 100644 index cab79ab8953..00000000000 --- a/cypress/e2e/catalog/giftCards/activateGiftCards.js +++ /dev/null @@ -1,268 +0,0 @@ -/// -import faker from "faker"; - -import { - GIFT_CARD_LIST, -} from "../../../elements/catalog/giftCard/giftCardList"; -import { urlList } from "../../../fixtures/urlList"; -import { completeCheckout } from "../../../support/api/requests/Checkout"; -import { - createGiftCard, - giftCardDeactivate, -} from "../../../support/api/requests/GiftCard"; -import { - createCheckoutWithDisabledGiftCard, - isGiftCardDataAsExpected, - purchaseProductWithActiveGiftCard, -} from "../../../support/api/utils/catalog/giftCardUtils"; -import { - addPayment, - purchaseProductWithPromoCode, -} from "../../../support/api/utils/ordersUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/taxesUtils"; -import { giftCardsPage } from "../../../support/pages"; - -describe("As a admin I want to use enabled gift card in checkout", () => { - const startsWith = "ActivateGiftCards"; - const productPrice = 50; - const shippingPrice = 50; - const email = "example@example.com"; - const giftCardData = { - amount: 150, - currency: "USD", - }; - - let defaultChannel; - let address; - let dataForCheckout; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - - productsUtils - .createProductWithShipping({ name, shippingPrice, productPrice }) - .then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; - - dataForCheckout = { - address, - email, - auth: "token", - channelSlug: defaultChannel.slug, - shippingMethodName: resp.shippingMethod.name, - variantsList: resp.variantsList, - }; - cy.checkIfDataAreNotNull(dataForCheckout); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - - it( - "should be able to enable gift card and use it in checkout. TC: SALEOR_1006", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const expectedGiftCardBalance = - giftCardData.amount - productPrice - shippingPrice; - - giftCardData.tag = `${startsWith}${faker.datatype.number()}`; - let giftCard; - - createGiftCard(giftCardData) - .then(giftCardResp => { - giftCard = giftCardResp; - giftCardDeactivate(giftCard.id); - }) - .then(() => { - giftCardsPage.changeGiftCardActiveStatus(giftCard.id); - dataForCheckout.voucherCode = giftCard.code; - purchaseProductWithPromoCode(dataForCheckout); - }) - .then(({ order }) => { - expect(order.total.gross.amount).to.eq(0); - expect(order.userEmail).to.eq(email); - isGiftCardDataAsExpected({ - giftCardId: giftCard.id, - expectedAmount: expectedGiftCardBalance, - userEmail: email, - initialBalance: giftCardData.amount, - }); - }) - .then(dataAsExpected => { - expect(dataAsExpected).to.be.true; - }); - }, - ); - - it( - "should not be able to disable gift card and use it in checkout. TC: SALEOR_1007", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - giftCardData.tag = `${startsWith}${faker.datatype.number()}`; - let giftCard; - - createGiftCard(giftCardData) - .then(giftCardResp => { - giftCard = giftCardResp; - giftCardsPage.changeGiftCardActiveStatus(giftCard.id); - dataForCheckout.voucherCode = giftCard.code; - createCheckoutWithDisabledGiftCard(dataForCheckout); - }) - .then(checkout => { - addPayment(checkout.id); - completeCheckout(checkout.id); - }) - .then(() => { - isGiftCardDataAsExpected({ - giftCardId: giftCard.id, - expectedAmount: giftCardData.amount, - }); - }) - .then(dataAsExpected => { - expect(dataAsExpected).to.be.true; - }); - }, - ); - - it( - "should not be able to disable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1013", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const firstGiftCardTag = faker.datatype.number(); - const secondGiftCardTag = faker.datatype.number(); - const amount = 10; - let firstGiftCard; - let firstGiftCardCode; - let secondGiftCard; - let secondGiftCardCode; - cy.addAliasToGraphRequest("GiftCardBulkDeactivate"); - createGiftCard({ - tag: firstGiftCardTag, - amount, - currency: "USD", - }) - .then(giftCard => { - firstGiftCard = giftCard; - firstGiftCardCode = firstGiftCard.code; - createGiftCard({ - tag: secondGiftCardTag, - amount, - currency: "USD", - }); - }) - .then(giftCard => { - secondGiftCard = giftCard; - secondGiftCardCode = secondGiftCard.code; - cy.visit( - giftCardsPage.getUrlWithFilteredTags(urlList.giftCards, [ - firstGiftCardTag, - secondGiftCardTag, - ]), - ); - - giftCardsPage.selectGiftCardOnListView(secondGiftCardCode); - giftCardsPage.selectGiftCardOnListView(firstGiftCardCode); - giftCardsPage.clickDeactivateButton(); - cy.waitForRequestAndCheckIfNoErrors( - "@GiftCardBulkDeactivate", - ).confirmationMessageShouldAppear(); - dataForCheckout.voucherCode = firstGiftCard.code; - createCheckoutWithDisabledGiftCard(dataForCheckout); - dataForCheckout.voucherCode = secondGiftCard.code; - createCheckoutWithDisabledGiftCard(dataForCheckout); - }) - .then(checkout => { - addPayment(checkout.id); - completeCheckout(checkout.id); - }) - .then(() => { - isGiftCardDataAsExpected({ - giftCardId: firstGiftCard.id, - expectedAmount: amount, - }).then(dataAsExpected => expect(dataAsExpected).to.be.true); - isGiftCardDataAsExpected({ - giftCardId: secondGiftCard.id, - expectedAmount: amount, - }).then(dataAsExpected => expect(dataAsExpected).to.be.true); - }); - }, - ); - - it( - "should be able to enable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1012", - { tags: ["@giftCard", "@allEnv"] }, - () => { - const amount = 10; - const expectedOrderPrice = shippingPrice + productPrice - amount; - const firstGiftCardTag = faker.datatype.number(); - const secondGiftCardTag = faker.datatype.number(); - let firstGiftCard; - let firstGiftCardCode; - let secondGiftCard; - let secondGiftCardCode; - cy.addAliasToGraphRequest("GiftCardBulkActivate"); - createGiftCard({ - tag: firstGiftCardTag, - amount, - currency: "USD", - isActive: false, - }) - .then(giftCard => { - firstGiftCard = giftCard; - firstGiftCardCode = giftCard.code; - - createGiftCard({ - tag: secondGiftCardTag, - amount, - currency: "USD", - isActive: false, - }); - }) - .then(giftCard => { - secondGiftCard = giftCard; - secondGiftCardCode = giftCard.code; - cy.visit( - giftCardsPage.getUrlWithFilteredTags(urlList.giftCards, [ - firstGiftCardTag, - secondGiftCardTag, - ]), - ); - giftCardsPage.selectGiftCardOnListView(secondGiftCardCode); - giftCardsPage.selectGiftCardOnListView(firstGiftCardCode); - cy.get(GIFT_CARD_LIST.activateGiftCardButton) - .click() - .waitForRequestAndCheckIfNoErrors("@GiftCardBulkActivate") - .confirmationMessageShouldAppear(); - dataForCheckout.voucherCode = firstGiftCard.code; - purchaseProductWithActiveGiftCard({ - giftCard: firstGiftCard, - expectedAmount: 0, - initialAmount: amount, - dataForCheckout, - expectedOrderPrice, - }).then(isDataAsExpected => expect(isDataAsExpected).to.be.true); - dataForCheckout.voucherCode = secondGiftCard.code; - purchaseProductWithActiveGiftCard({ - giftCard: secondGiftCard, - expectedAmount: 0, - initialAmount: amount, - dataForCheckout, - expectedOrderPrice, - }).then(isDataAsExpected => expect(isDataAsExpected).to.be.true); - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/giftCards/createGiftCard.js b/cypress/e2e/catalog/giftCards/createGiftCard.js deleted file mode 100644 index c118d8d0269..00000000000 --- a/cypress/e2e/catalog/giftCards/createGiftCard.js +++ /dev/null @@ -1,113 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { getGiftCardsWithCode } from "../../../support/api/requests/GiftCard"; -import { addToDate } from "../../../support/api/utils/misc"; -import { formatDate } from "../../../support/formatData/formatDate"; -import { - expiryPeriods, - openAndFillUpCreateGiftCardDialog, - saveGiftCard, - setExpiryDate, - setExpiryPeriod, -} from "../../../support/pages/catalog/giftCardPage"; - -describe("As an admin I want to create gift card", () => { - const startsWith = "CreateGCards"; - const amount = 50; - const currency = "USD"; - - before(() => { - cy.loginUserViaRequest(); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to create never expire gift card. TC: SALEOR_1001", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let giftCard; - - openAndFillUpCreateGiftCardDialog({ - note: name, - tag: name, - amount, - currency, - }); - saveGiftCard() - .then(giftCardResp => { - giftCard = giftCardResp; - getGiftCardsWithCode(giftCard.code); - }) - .then(giftCardsResp => { - expect(giftCardsResp[0].node.code).to.eq(giftCard.code); - expect(giftCardsResp[0].node.initialBalance.amount).to.eq(amount); - expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); - }); - }, - ); - - it( - "should be able to create gift card with two moths expiry. TC: SALEOR_1002", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let giftCard; - const expectedExpiryDate = addToDate(new Date(), 2, "M"); - - openAndFillUpCreateGiftCardDialog({ - note: name, - tag: name, - amount, - currency, - }); - setExpiryPeriod(2, expiryPeriods.MONTH); - saveGiftCard() - .then(giftCardResp => { - giftCard = giftCardResp; - getGiftCardsWithCode(giftCard.code); - }) - .then(giftCardsResp => { - expect(giftCardsResp[0].node.code).to.eq(giftCard.code); - expect(giftCardsResp[0].node.initialBalance.amount).to.eq(amount); - expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); - expect(giftCardsResp[0].node.expiryDate).to.eq(expectedExpiryDate); - }); - }, - ); - - it( - "should be able to create gift card with date expiry. TC: SALEOR_1003", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const date = formatDate(new Date(new Date().getFullYear() + 2, 1, 1)); - let giftCard; - - openAndFillUpCreateGiftCardDialog({ - note: name, - tag: name, - amount, - currency, - }); - setExpiryDate(date); - saveGiftCard() - .then(giftCardResp => { - giftCard = giftCardResp; - getGiftCardsWithCode(giftCard.code); - }) - .then(giftCardsResp => { - expect(giftCardsResp[0].node.code).to.eq(giftCard.code); - expect(giftCardsResp[0].node.initialBalance.amount).to.eq(amount); - expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); - expect(giftCardsResp[0].node.expiryDate).to.eq(date); - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/giftCards/exportGiftCards.js b/cypress/e2e/catalog/giftCards/exportGiftCards.js deleted file mode 100644 index 29ca4545f07..00000000000 --- a/cypress/e2e/catalog/giftCards/exportGiftCards.js +++ /dev/null @@ -1,143 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../../fixtures/urlList"; -import { TEST_ADMIN_USER } from "../../../fixtures/users"; -import { createGiftCard } from "../../../support/api/requests/GiftCard"; -import { - activatePlugin, - updatePlugin, -} from "../../../support/api/requests/Plugins"; -import { - getMailWithGiftCardExportWithAttachment, -} from "../../../support/api/utils/users"; -import { giftCardsPage } from "../../../support/pages"; - -describe("As an admin I want to export gift card", () => { - const startsWith = "updateGCard"; - - before(() => { - cy.loginUserViaRequest(); - activatePlugin({ id: "mirumee.notifications.admin_email" }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to export several gift cards to csv file. TC: SALEOR_1010", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const firstGiftCardTag = faker.datatype.number(); - const secondGiftCardTag = faker.datatype.number(); - const exportId = `${faker.datatype.number()}`; - let firstGiftCardId; - let secondGiftCardId; - let firstGiftCardCode; - let secondGiftCardCode; - - updatePlugin( - "mirumee.notifications.admin_email", - "csv_export_success_subject", - `Your exported {{ data_type }} data #${exportId} is ready`, - ); - createGiftCard({ - tag: firstGiftCardTag, - amount: 5, - currency: "THB", - }) - .then(firstGiftCard => { - firstGiftCardId = firstGiftCard.id; - firstGiftCardCode = firstGiftCard.code; - createGiftCard({ - tag: secondGiftCardTag, - amount: 10, - currency: "THB", - }); - }) - .then(secondGiftCard => { - secondGiftCardCode = secondGiftCard.code; - secondGiftCardId = secondGiftCard.id; - cy.visit( - giftCardsPage.getUrlWithFilteredTags(urlList.giftCards, [ - firstGiftCardTag, - secondGiftCardTag, - ]), - ); - giftCardsPage.selectGiftCardOnListView(secondGiftCardCode); - giftCardsPage.selectGiftCardOnListView(firstGiftCardCode); - giftCardsPage.openExportGiftCardsDialog(); - giftCardsPage.selectSelectedRecordsButton(); - giftCardsPage.selectExportAsCSVButton(); - cy.clickSubmitButton(); - getMailWithGiftCardExportWithAttachment( - TEST_ADMIN_USER.email, - `Your exported gift cards data #${exportId} is ready`, - "csv", - ).then(body => { - expect(body).to.contain(".csv"); - }); - }); - }, - ); - - it( - "should be able to export several gift cards to xlsx file. TC: SALEOR_1014", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const firstGiftCardTag = faker.datatype.number(); - const secondGiftCardTag = faker.datatype.number(); - const exportId = `${faker.datatype.number()}`; - let firstGiftCardId; - let secondGiftCardId; - let firstGiftCardCode; - let secondGiftCardCode; - - updatePlugin( - "mirumee.notifications.admin_email", - "csv_export_success_subject", - `Your exported {{ data_type }} data #${exportId} is ready`, - ); - createGiftCard({ - tag: firstGiftCardTag, - amount: 5, - currency: "THB", - }) - .then(firstGiftCard => { - firstGiftCardId = firstGiftCard.id; - firstGiftCardCode = firstGiftCard.code; - createGiftCard({ - tag: secondGiftCardTag, - amount: 10, - currency: "THB", - }); - }) - .then(secondGiftCard => { - secondGiftCardId = secondGiftCard.id; - secondGiftCardCode = secondGiftCard.code; - cy.visit( - giftCardsPage.getUrlWithFilteredTags(urlList.giftCards, [ - firstGiftCardTag, - secondGiftCardTag, - ]), - ); - giftCardsPage.selectGiftCardOnListView(secondGiftCardCode); - giftCardsPage.selectGiftCardOnListView(firstGiftCardCode); - giftCardsPage.openExportGiftCardsDialog(); - giftCardsPage.selectSelectedRecordsButton(); - giftCardsPage.selectExportAsXLSXButton(); - cy.clickSubmitButton(); - getMailWithGiftCardExportWithAttachment( - TEST_ADMIN_USER.email, - `Your exported gift cards data #${exportId} is ready`, - "xlsx", - ).then(body => { - expect(body).to.contain(".xlsx"); - }); - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js b/cypress/e2e/catalog/giftCards/purchaseGiftCard.js deleted file mode 100644 index 051e1f64e02..00000000000 --- a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js +++ /dev/null @@ -1,110 +0,0 @@ -/// -import faker from "faker"; - -import * as channelsUtils from "../../../support/api/utils/channelsUtils"; -import { - createWaitingForCaptureOrder, -} from "../../../support/api/utils/ordersUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../../support/api/utils/shippingUtils"; - -describe("As a customer I should be able to purchase gift card as a product", () => { - const startsWith = "GiftCardsCheckout"; - const productPrice = 50; - const shippingPrice = 50; - const email = "example@example.com"; - - let defaultChannel; - let productType; - let attribute; - let category; - let shippingMethod; - let variants; - let address; - const giftCardData = { - amount: 150, - currency: "USD", - }; - - before(() => { - cy.loginUserViaRequest(); - - const name = `${startsWith}${faker.datatype.number()}`; - - productsUtils - .createTypeAttributeAndCategoryForProduct({ name, kind: "GIFT_CARD" }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp, - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - - channelsUtils.getDefaultChannel(); - }, - ) - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createShipping({ - channelId: defaultChannel.id, - name, - address, - price: shippingPrice, - }); - }) - .then(({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => { - shippingMethod = shippingMethodResp; - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice, - }); - }) - .then(({ variantsList: variantsResp }) => { - variants = variantsResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - productType, - attribute, - category, - shippingMethod, - variants, - address, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to purchase gift card as a product. TC: SALEOR_1008", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - giftCardData.tag = `${startsWith}${faker.datatype.number()}`; - - createWaitingForCaptureOrder({ - address, - channelSlug: defaultChannel.slug, - email, - shippingMethodName: shippingMethod.name, - variantsList: variants, - }).then(({ order }) => { - expect(order.id).to.be.ok; - }); - }, - ); -}); diff --git a/cypress/e2e/catalog/giftCards/updatingGiftCards.js b/cypress/e2e/catalog/giftCards/updatingGiftCards.js deleted file mode 100644 index fadd85b759a..00000000000 --- a/cypress/e2e/catalog/giftCards/updatingGiftCards.js +++ /dev/null @@ -1,141 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - GIFT_CARD_UPDATE, -} from "../../../elements/catalog/giftCard/giftCardUpdate"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { MESSAGES } from "../../../fixtures"; -import { - giftCardDetailsUrl, - urlList, -} from "../../../fixtures/urlList"; -import { - createGiftCard, - getGiftCardWithId, -} from "../../../support/api/requests/GiftCard"; -import { formatDate } from "../../../support/formatData/formatDate"; -import { giftCardsPage } from "../../../support/pages"; - -describe("As an admin I want to update gift card", () => { - const startsWith = "updateGCard"; - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to delete gift card. TC: SALEOR_1004", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createGiftCard({ - tag: name, - amount: 10, - currency: "USD", - }).then(giftCard => { - cy.visit(giftCardDetailsUrl(giftCard.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("DeleteGiftCard") - .get(GIFT_CARD_UPDATE.consentCheckbox) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@DeleteGiftCard"); - getGiftCardWithId(giftCard.id).should("be.null"); - }); - }, - ); - - it( - "should be able to update gift card. TC: SALEOR_1005", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}${faker.datatype.number()}`; - const date = formatDate(new Date(new Date().getFullYear() + 2, 1, 1)); - - createGiftCard({ - tag: name, - amount: 10, - currency: "USD", - }) - .then(giftCard => { - cy.visit(giftCardDetailsUrl(giftCard.id)) - .waitForProgressBarToNotBeVisible() - .get(GIFT_CARD_UPDATE.expireCheckbox) - .click() - .get(GIFT_CARD_UPDATE.expireDateInput) - .type(date) - .get(GIFT_CARD_UPDATE.removeTagButton) - .click() - .get(GIFT_CARD_UPDATE.giftCardTagSelect) - .find("input") - .clear() - .type(updatedName) - .get(GIFT_CARD_UPDATE.autocompleteCustomOption) - .click() - .addAliasToGraphRequest("GiftCardUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@GiftCardUpdate"); - getGiftCardWithId(giftCard.id); - }) - .then(giftCard => { - expect(giftCard.tags[0].name.toLowerCase()).to.eq( - updatedName.toLowerCase(), - ); - expect(giftCard.expiryDate).to.eq(date); - }); - }, - ); - - it( - "should be able to delete several gift cards. TC: SALEOR_1011", - { tags: ["@giftCard", "@allEnv", "@stable"] }, - () => { - const firstGiftCardTag = faker.datatype.number(); - const secondGiftCardTag = faker.datatype.number(); - let firstGiftCardId; - let secondGiftCardId; - let firstGiftCardCode; - let secondGiftCardCode; - cy.addAliasToGraphRequest("BulkDeleteGiftCard"); - - createGiftCard({ - tag: firstGiftCardTag, - amount: 3, - currency: "THB", - }) - .then(firstGiftCard => { - firstGiftCardId = firstGiftCard.id; - firstGiftCardCode = firstGiftCard.code; - createGiftCard({ - tag: secondGiftCardTag, - amount: 7, - currency: "THB", - }); - }) - .then(secondGiftCard => { - secondGiftCardCode = secondGiftCard.code; - secondGiftCardId = secondGiftCard.id; - cy.visit( - giftCardsPage.getUrlWithFilteredTags(urlList.giftCards, [ - firstGiftCardTag, - secondGiftCardTag, - ]), - ); - giftCardsPage.selectGiftCardOnListView(secondGiftCardCode); - giftCardsPage.selectGiftCardOnListView(firstGiftCardCode); - giftCardsPage.bulkDeleteRecords(); - cy.waitForRequestAndCheckIfNoErrors("@BulkDeleteGiftCard"); - cy.contains(MESSAGES.noGiftCardsFound).should("be.visible"); - getGiftCardWithId(firstGiftCardId).should("be.null"); - getGiftCardWithId(secondGiftCardId).should("be.null"); - }); - }, - ); -}); diff --git a/cypress/e2e/checkout/clickAndCollect.js b/cypress/e2e/checkout/clickAndCollect.js deleted file mode 100644 index 321a9fc7d5a..00000000000 --- a/cypress/e2e/checkout/clickAndCollect.js +++ /dev/null @@ -1,271 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - WAREHOUSES_DETAILS, -} from "../../elements/warehouses/warehouse-details"; -import { - completeCheckout, - createCheckout, - deliveryMethodUpdate, -} from "../../support/api/requests/Checkout"; -import { getOrder } from "../../support/api/requests/Order"; -import { updateWarehouse } from "../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../support/api/utils/channelsUtils"; -import { addPayment } from "../../support/api/utils/ordersUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../support/api/utils/shippingUtils"; -import { - createWarehouse, - pickupOptions, - visitAndEnablePickup, - visitSetPublicStockAndEnablePickup, -} from "../../support/pages/warehousePage"; - -describe("Warehouses in checkout", () => { - const startsWith = `clickAndCollect`; - let defaultChannel; - let usAddress; - let secondUsAddress; - let productData; - let checkoutData; - let variantsInOtherWarehouse; - const productSku = `${faker.lorem.slug()}slug`; - const productTypeSlug = `${faker.lorem.slug()}slug`; - const productSlug = `${faker.lorem.slug()}slug`; - const warehouseSlug = `${faker.lorem.slug()}slug`; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("addresses") - .then(addresses => { - usAddress = addresses.usAddress; - secondUsAddress = addresses.secondUsAddress; - - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createTypeAttributeAndCategoryForProduct({ - name: startsWith, - slug: productTypeSlug, - }); - }) - .then(({ attribute, productType, category }) => { - productData = { - attributeId: attribute.id, - categoryId: category.id, - channelId: defaultChannel.id, - productTypeId: productType.id, - quantityInWarehouse: 100, - }; - checkoutData = { - returnAvailableCollectionPoints: true, - channelSlug: defaultChannel.slug, - email: "example@example.com", - address: secondUsAddress, - billingAddress: usAddress, - }; - createShipping({ - channelId: defaultChannel.id, - name: startsWith, - address: secondUsAddress, - slug: warehouseSlug, - }); - }) - .then(({ warehouse: warehouseResp }) => { - productData.name = startsWith; - productData.warehouseId = warehouseResp.id; - - updateWarehouse({ id: productData.warehouseId, isPrivate: false }); - createProductInChannel({ - ...productData, - slug: productSlug, - sku: productSku, - }); - }) - .then(({ variantsList }) => { - variantsInOtherWarehouse = variantsList; - cy.checkIfDataAreNotNull({ - defaultChannel, - usAddress, - secondUsAddress, - productData, - checkoutData, - variantsInOtherWarehouse, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create warehouse with all warehouses pickup and private stock", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const secondProductSlug = `${faker.lorem.slug()}slug`; - - let warehouse; - - createShipping({ - channelId: defaultChannel.id, - name, - address: secondUsAddress, - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - productData.name = name; - productData.warehouseId = warehouse.id; - - visitAndEnablePickup(warehouse.id); - createProductInChannel({ ...productData, slug: secondProductSlug }); - }) - .then(({ variantsList }) => { - checkoutData.variantsList = variantsList.concat( - variantsInOtherWarehouse, - ); - createCheckout(checkoutData); - }) - .then(({ checkout }) => { - const clickAndCollectOption = checkout.availableCollectionPoints.find( - element => element.id === warehouse.id, - ); - expect(clickAndCollectOption.clickAndCollectOption).to.eq("ALL"); - expect(clickAndCollectOption.id).to.eq(warehouse.id); - expect(clickAndCollectOption.isPrivate).to.eq(true); - expect(clickAndCollectOption.name).to.eq(warehouse.name); - }); - }, - ); - - it( - "should create warehouse with all warehouses pickup and public stock", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let warehouse; - - createShipping({ - channelId: defaultChannel.id, - name, - address: secondUsAddress, - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - productData.name = name; - productData.warehouseId = warehouse.id; - - visitSetPublicStockAndEnablePickup(warehouse.id); - createProductInChannel(productData); - }) - .then(({ variantsList }) => { - checkoutData.variantsList = variantsList.concat( - variantsInOtherWarehouse, - ); - createCheckout(checkoutData); - }) - .then(({ checkout }) => { - const clickAndCollectOption = checkout.availableCollectionPoints.find( - element => element.id === warehouse.id, - ); - expect(clickAndCollectOption.clickAndCollectOption).to.eq("ALL"); - expect(clickAndCollectOption.id).to.eq(warehouse.id); - expect(clickAndCollectOption.isPrivate).to.eq(false); - expect(clickAndCollectOption.name).to.eq(warehouse.name); - }); - }, - ); - - it( - "should create warehouse with local stock only pickup and public stock", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let warehouse; - let variantsInLocalStock; - - createShipping({ - channelId: defaultChannel.id, - name, - address: secondUsAddress, - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - productData.name = name; - productData.warehouseId = warehouse.id; - - visitSetPublicStockAndEnablePickup(warehouse.id, pickupOptions.local); - createProductInChannel(productData); - }) - .then(({ variantsList }) => { - variantsInLocalStock = variantsList; - checkoutData.variantsList = variantsInLocalStock.concat( - variantsInOtherWarehouse, - ); - createCheckout(checkoutData); - }) - .then(({ checkout }) => { - expect(checkout.availableCollectionPoints).to.have.length( - 1, - "there should be no available collection point for local stock", - ); - - checkoutData.variantsList = variantsInLocalStock; - - createCheckout(checkoutData) - .its("checkout.availableCollectionPoints.0") - .should("include", { id: warehouse.id }) - .and("include", { isPrivate: false }) - .and("include", { name: warehouse.name }) - .and("include", { clickAndCollectOption: "LOCAL" }); - }); - }, - ); - - it( - "should not be possible to set local pickup when private stock", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createWarehouse({ name, address: usAddress }); - cy.get(WAREHOUSES_DETAILS.clickAndCollectLocalStockRadioButton).should( - "not.exist", - ); - }, - ); - it( - "should create order with warehouse address", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - checkoutData.variantsList = variantsInOtherWarehouse; - - createCheckout(checkoutData) - .then(checkoutResp => { - const clickAndCollectOption = - checkoutResp.checkout.availableCollectionPoints[0]; - deliveryMethodUpdate( - clickAndCollectOption.id, - checkoutResp.checkout.token, - ); - addPayment(checkoutResp.checkout.id); - completeCheckout(checkoutResp.checkout.id); - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - cy.expectCorrectBasicAddress(order.shippingAddress, secondUsAddress); - cy.expectCorrectBasicAddress(order.billingAddress, usAddress); - }); - }, - ); -}); diff --git a/cypress/e2e/checkout/productWithoutShipping.js b/cypress/e2e/checkout/productWithoutShipping.js deleted file mode 100644 index cb2f69dfb0b..00000000000 --- a/cypress/e2e/checkout/productWithoutShipping.js +++ /dev/null @@ -1,124 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { createChannel } from "../../support/api/requests/Channels"; -import { - addProductsToCheckout, - addShippingMethod, - createCheckout, -} from "../../support/api/requests/Checkout"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../support/api/utils/shippingUtils"; - -describe("Products without shipment option", () => { - const startsWith = "WithoutShipmentCheckout-"; - const name = `${startsWith}${faker.datatype.number()}`; - const nameProdWithoutShipping = `${startsWith}${faker.datatype.number()}`; - - let channel; - let address; - let warehouse; - let shippingMethod; - let productWithShipping; - let productWithoutShipping; - - before(() => { - cy.loginUserViaRequest(); - - createChannel({ - name, - }) - .then(channelResp => { - channel = channelResp; - cy.fixture("addresses"); - }) - .then(({ usAddress }) => { - address = usAddress; - createShipping({ - channelId: channel.id, - name, - address, - minProductPrice: 100, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - createTypeAttributeAndCategoryForProduct({ name }); - }, - ) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - createProductInChannel({ - attributeId: attributeResp.id, - categoryId: categoryResp.id, - channelId: channel.id, - name, - productTypeId: productTypeResp.id, - warehouseId: warehouse.id, - }).then(({ variantsList }) => (productWithShipping = variantsList)); - createProductInChannel({ - attributeId: attributeResp.id, - categoryId: categoryResp.id, - channelId: channel.id, - name: nameProdWithoutShipping, - productTypeId: productTypeResp.id, - warehouseId: warehouse.id, - }).then(({ variantsList }) => { - productWithoutShipping = variantsList; - cy.checkIfDataAreNotNull({ - channel, - address, - warehouse, - shippingMethod, - productWithShipping, - productWithoutShipping, - }); - }); - }, - ); - }); - - it( - "should be not possible to buy product without shipping option", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - createCheckout({ - channelSlug: channel.slug, - email: "example@example.com", - variantsList: productWithoutShipping, - address, - auth: "token", - }) - .then(({ checkout }) => { - expect( - checkout.shippingMethods, - "expect no available shipping", - ).to.have.length(0); - addProductsToCheckout(checkout.id, productWithShipping, 1); - }) - .then(({ checkout }) => { - expect( - checkout.shippingMethods, - "expect no available shipping", - ).to.have.length(0); - addShippingMethod(checkout.id, shippingMethod.id); - }) - .then(({ errors }) => { - expect(errors[0].field, "expect error in shipping method").to.be.eq( - "shippingMethodId", - ); - }); - }, - ); -}); diff --git a/cypress/e2e/checkout/purchaseWithProductTypes.js b/cypress/e2e/checkout/purchaseWithProductTypes.js deleted file mode 100644 index b74e56ecb7d..00000000000 --- a/cypress/e2e/checkout/purchaseWithProductTypes.js +++ /dev/null @@ -1,167 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - checkoutShippingAddressUpdate, - checkoutVariantsUpdate, - completeCheckout, - createCheckout, -} from "../../support/api/requests/Checkout"; -import { getOrder } from "../../support/api/requests/Order"; -import { - addPayment, - createAndCompleteCheckoutWithoutShipping, - createWaitingForCaptureOrder, - getShippingMethodIdFromCheckout, - updateShippingInCheckout, -} from "../../support/api/utils/ordersUtils"; -import { createDigitalAndPhysicalProductWithNewDataAndDefaultChannel } from "../../support/api/utils/products/productsUtils"; - -describe("As an unlogged customer I want to order physical and digital products", () => { - const startsWith = `CyPurchaseByType`; - const email = `${startsWith}@example.com`; - const testsMessage = "Check order status"; - const digitalName = `${startsWith}${faker.datatype.number()}`; - const physicalName = `${startsWith}${faker.datatype.number()}`; - - let defaultChannel; - let address; - let shippingMethod; - let digitalVariants; - let physicalVariants; - - before(() => { - cy.loginUserViaRequest(); - createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({ - physicalProductName: physicalName, - digitalProductName: digitalName, - }).then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; - shippingMethod = resp.shippingMethod; - digitalVariants = resp.digitalVariants; - physicalVariants = resp.physicalVariants; - cy.checkIfDataAreNotNull({ - defaultChannel, - address, - shippingMethod, - digitalVariants, - physicalVariants, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should purchase digital product as unlogged customer. TC: SALEOR_0402 - should not be migrated to playwright", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease", "@critical"] }, - () => { - createAndCompleteCheckoutWithoutShipping({ - channelSlug: defaultChannel.slug, - email, - billingAddress: address, - variantsList: digitalVariants, - auth: "token", - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect( - order.isShippingRequired, - "Check if is shipping required in order", - ).to.eq(false); - expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); - }); - }, - ); - - it( - "should purchase physical product as unlogged customer. TC: SALEOR_0403 should not be migrated to playwright", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease", "@critical"] }, - () => { - createWaitingForCaptureOrder({ - channelSlug: defaultChannel.slug, - email, - variantsList: physicalVariants, - shippingMethodName: shippingMethod.name, - address, - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect( - order.isShippingRequired, - "Check if is shipping required in order", - ).to.eq(true); - expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); - }); - }, - ); - - it( - "should purchase multiple products with all product types as unlogged customer. TC: SALEOR_0404", - { tags: ["@checkout", "@allEnv", "@stable"] }, - () => { - let checkout; - - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList: digitalVariants, - billingAddress: address, - auth: "token", - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - addPayment(checkout.id); - }) - .then(() => { - checkoutVariantsUpdate(checkout.id, physicalVariants); - }) - .then(() => { - const shippingMethodId = getShippingMethodIdFromCheckout( - checkout, - shippingMethod.name, - ); - expect( - shippingMethodId, - "Should be not possible to add shipping method without shipping address", - ).to.not.be.ok; - checkoutShippingAddressUpdate(checkout.id, address); - }) - .then(() => { - addPayment(checkout.id); - }) - .then(({ errors }) => { - expect( - errors, - "Should be not possible to add payment without shipping", - ).to.have.lengthOf(1); - updateShippingInCheckout(checkout.token, shippingMethod.name); - }) - .then(() => { - addPayment(checkout.id); - }) - .then(() => { - completeCheckout(checkout.id); - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect( - order.isShippingRequired, - "Check if is shipping required in order", - ).to.eq(true); - expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); - }); - }, - ); -}); diff --git a/cypress/e2e/checkout/stocksInCheckout.js b/cypress/e2e/checkout/stocksInCheckout.js deleted file mode 100644 index 26ee5b2a147..00000000000 --- a/cypress/e2e/checkout/stocksInCheckout.js +++ /dev/null @@ -1,137 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - addProductsToCheckout, - createCheckout, -} from "../../support/api/requests/Checkout"; -import { getVariants } from "../../support/api/requests/Product"; -import { - createWaitingForCaptureOrder, -} from "../../support/api/utils/ordersUtils"; -import { - createNewProductWithSeveralVariants, -} from "../../support/api/utils/products/productsUtils"; - -describe("Manage products stocks in checkout", () => { - const startsWith = "CyStocksCheckout-"; - const name = `${startsWith}${faker.datatype.number()}`; - - let defaultChannel; - let address; - let shippingMethod; - let variantsWithLowStock; - let variantsWithoutTrackInventory; - let lastVariantInStock; - - before(() => { - cy.loginUserViaRequest(); - - const variantsData = [ - { - name: "variantsWithLowStock", - trackInventory: true, - quantityInWarehouse: 1, - }, - { - name: "variantsWithoutTrackInventory", - trackInventory: false, - quantityInWarehouse: 0, - }, - { - name: "lastVariantInStock", - trackInventory: true, - quantityInWarehouse: 1, - }, - ]; - - createNewProductWithSeveralVariants(name, variantsData).then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; - shippingMethod = resp.shippingMethod; - variantsWithLowStock = resp.createdVariants.find( - variant => variant.name === "variantsWithLowStock", - ); - variantsWithoutTrackInventory = resp.createdVariants.find( - variant => variant.name === "variantsWithoutTrackInventory", - ); - lastVariantInStock = resp.createdVariants.find( - variant => variant.name === "lastVariantInStock", - ); - cy.checkIfDataAreNotNull({ - defaultChannel, - address, - shippingMethod, - variantsWithLowStock, - variantsWithoutTrackInventory, - lastVariantInStock, - }); - }); - }); - - it( - "should not be possible to add product with quantity greater than stock to checkout. TC: SALEOR_0405", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease"] }, - () => { - createCheckout({ - channelSlug: defaultChannel.slug, - address, - billingAddress: address, - email: "email@example.com", - variantsList: [variantsWithLowStock], - auth: "token", - }) - .then(({ checkout: checkout }) => { - addProductsToCheckout(checkout.id, [variantsWithLowStock], 2); - }) - .then(({ errors }) => { - expect( - errors[0], - "should return error on field quantity", - ).to.have.property("field", "quantity"); - }); - }, - ); - - it( - "should buy product with no quantity if tracking is not set. TC: SALEOR_0406", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease"] }, - () => { - createWaitingForCaptureOrder({ - address, - channelSlug: defaultChannel.slug, - email: "example@example.com", - shippingMethodName: shippingMethod.name, - variantsList: [variantsWithoutTrackInventory], - }).then(({ order }) => { - expect(order, "order should be created").to.be.ok; - }); - }, - ); - - it( - "should create checkout with last product in stock. TC: SALEOR_0419", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease"] }, - () => { - createWaitingForCaptureOrder({ - address, - channelSlug: defaultChannel.slug, - email: "example@example.com", - shippingMethodName: shippingMethod.name, - variantsList: [lastVariantInStock], - }) - .then(({ order }) => { - expect(order, "order should be created").to.be.ok; - cy.clearSessionData().loginUserViaRequest(); - getVariants([lastVariantInStock]); - }) - .then(variantsList => { - const variant = variantsList.edges[0]; - expect(variant.node.stocks[0].quantityAllocated).to.eq(1); - expect(variant.node.stocks[0].quantity).to.eq(1); - }); - }, - ); -}); diff --git a/cypress/e2e/checkout/warehouses.js b/cypress/e2e/checkout/warehouses.js deleted file mode 100644 index 161ca4a30bb..00000000000 --- a/cypress/e2e/checkout/warehouses.js +++ /dev/null @@ -1,68 +0,0 @@ -/// -/// -import faker from "faker"; - -import { createCheckout } from "../../support/api/requests/Checkout"; -import { getDefaultChannel } from "../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../support/api/utils/shippingUtils"; - -describe("Warehouses in checkout", () => { - const startsWith = `CyWarehouseCheckout`; - let defaultChannel; - let usAddress; - let plAddress; - let warehouse; - - it( - "should not be possible to buy product for country not listed in warehouse", - { tags: ["@checkout", "@allEnv", "@stable", "@oldRelease"] }, - () => { - cy.loginUserViaRequest(); - const name = `${startsWith}${faker.datatype.number()}`; - cy.fixture("addresses") - .then(addresses => { - usAddress = addresses.usAddress; - plAddress = addresses.plAddress; - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createShipping({ - channelId: defaultChannel.id, - name, - address: usAddress, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, productType, category }) => { - createProductInChannel({ - name, - attributeId: attribute.id, - categoryId: category.id, - channelId: defaultChannel.id, - productTypeId: productType.id, - warehouseId: warehouse.id, - quantityInWarehouse: 100, - }); - }) - .then(({ variantsList }) => { - createCheckout({ - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList, - address: plAddress, - }); - }) - .then(({ errors }) => { - expect(errors[0]).to.have.property("field", "quantity"); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/attributes/attributeVariantSelection.js b/cypress/e2e/configuration/attributes/attributeVariantSelection.js deleted file mode 100644 index ad516eeac01..00000000000 --- a/cypress/e2e/configuration/attributes/attributeVariantSelection.js +++ /dev/null @@ -1,101 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { addVariantUrl } from "../../../fixtures/urlList"; -import { createCategory } from "../../../support/api/requests/Category"; -import { getVariant } from "../../../support/api/requests/Product"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createProductInChannelWithoutVariants, -} from "../../../support/api/utils/products/productsUtils"; -import { - createProductTypeWithNewVariantSelectionAttribute, -} from "../../../support/api/utils/productTypeUtils"; -import { - fillUpVariantDetails, -} from "../../../support/pages/catalog/products/VariantsPage"; - -describe("As an admin I want to use attributes in variant selection", () => { - const startsWith = "VarSel" + Date.now(); - - const attributesTypes = [ - { key: "DROPDOWN", TC: "SALEOR_0534" }, - { key: "BOOLEAN", TC: "SALEOR_0536" }, - { key: "NUMERIC", TC: "SALEOR_0537" }, - { key: "SWATCH", TC: "SALEOR_0538" }, - ]; - let channel; - let category; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel().then(defaultChannel => (channel = defaultChannel)); - createCategory({ name: startsWith }).then(categoryResp => { - category = categoryResp; - cy.checkIfDataAreNotNull({ channel, category }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - attributesTypes.forEach(attributeType => { - it( - `should create variant with ${attributeType.key} attribute. TC: ${attributeType.TC}`, - { tags: ["@attribute", "@allEnv"] }, - () => { - const name = `${startsWith}${ - attributeType.key - }${faker.datatype.number()}`; - const variantName = `cypress_variant_${faker.datatype.number()}`; - const inputType = attributeType.key; - const attributeValues = ["1", "2"]; - let productType; - let product; - - createProductTypeWithNewVariantSelectionAttribute({ - name, - inputType, - attributeValues, - }).then(({ productType: productTypeResp }) => { - productType = productTypeResp; - - createProductInChannelWithoutVariants({ - categoryId: category.id, - productTypeId: productType.id, - name, - channelId: channel.id, - }) - .then(productResp => { - product = productResp; - - cy.visit(addVariantUrl(product.id)).addAliasToGraphRequest( - "VariantCreate", - ); - - fillUpVariantDetails({ - sku: name, - attributeName: attributeValues[0], - attributeType: inputType, - costPrice: 10, - price: 10, - variantName, - }); - cy.wait("@VariantCreate"); - }) - .then(({ response }) => { - const variant = - response.body.data.productVariantCreate.productVariant; - getVariant(variant.id, channel.slug).then(({ attributes }) => { - expect(attributes[0].attribute.inputType).to.eq(inputType); - cy.confirmationMessageShouldAppear(); - }); - }); - }); - }, - ); - }); -}); diff --git a/cypress/e2e/configuration/attributes/createContentAttribute.js b/cypress/e2e/configuration/attributes/createContentAttribute.js deleted file mode 100644 index 2a3ef165f31..00000000000 --- a/cypress/e2e/configuration/attributes/createContentAttribute.js +++ /dev/null @@ -1,158 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - ATTRIBUTES_DETAILS, -} from "../../../elements/attribute/attributes_details"; -import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list"; -import { urlList } from "../../../fixtures/urlList"; -import { getAttribute } from "../../../support/api/requests/Attribute"; -import { - expectCorrectDataInAttribute, -} from "../../../support/api/utils/attributes/checkAttributeData"; -import { - createAttributeWithInputType, -} from "../../../support/pages/attributesPage"; - -describe("As an admin I want to create content attribute", () => { - const startsWith = "AttrCont" + Date.now(); - const attributesTypes = [ - { type: "DROPDOWN", testCase: "SALEOR_0512" }, - { type: "MULTISELECT", testCase: "SALEOR_0513" }, - { type: "FILE", testCase: "SALEOR_0514" }, - { type: "RICH_TEXT", testCase: "SALEOR_0515" }, - { type: "BOOLEAN", testCase: "SALEOR_0516" }, - { type: "DATE", testCase: "SALEOR_0527" }, - { type: "DATE_TIME", testCase: "SALEOR_0528" }, - ]; - const attributeReferenceType = [ - { type: "PRODUCT", testCase: "SALEOR_0517" }, - { type: "PAGE", testCase: "SALEOR_0518" }, - { type: "PRODUCT_VARIANT", testCase: "SALEOR_0539" }, - ]; - const attributeNumericType = [ - { - unitSystem: "IMPERIAL", - unitsOf: "DISTANCE", - unit: "FT", - testCase: "SALEOR_0519", - }, - { - unitSystem: "METRIC", - unitsOf: "VOLUME", - unit: "CUBIC_CENTIMETER", - testCase: "SALEOR_0520", - }, - { unitSystem: "without selecting unit", testCase: "SALEOR_0521" }, - ]; - - beforeEach(() => { - cy.loginUserViaRequest() - .visit(urlList.attributes) - .get(ATTRIBUTES_LIST.createAttributeButton) - .click() - .get(ATTRIBUTES_DETAILS.pageTypeAttributeCheckbox) - .click(); - }); - - attributesTypes.forEach(attributeType => { - it( - `should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeName = `${startsWith}${faker.datatype.number()}`; - createAttributeWithInputType({ - name: attributeName, - attributeType: attributeType.type, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType: attributeType.type, - }); - }); - }, - ); - }); - - attributeReferenceType.forEach(entityType => { - it( - `should be able to create reference to ${entityType.type} attribute. TC:${entityType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "REFERENCE"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - createAttributeWithInputType({ - name: attributeName, - attributeType, - entityType: entityType.type, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - entityType: entityType.type, - }); - }); - }, - ); - }); - - attributeNumericType.forEach(numericSystemType => { - it( - `should be able to create numeric ${numericSystemType.unitSystem} attribute. TC: ${numericSystemType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "NUMERIC"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - createAttributeWithInputType({ - name: attributeName, - attributeType, - numericSystemType, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - unit: numericSystemType.unit, - }); - }); - }, - ); - }); - - it( - "should be able to create attribute without require value TC:SALEOR_0522", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "BOOLEAN"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - createAttributeWithInputType({ - name: attributeName, - attributeType, - valueRequired: false, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - valueRequired: false, - }); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/attributes/createProductAttributes.js b/cypress/e2e/configuration/attributes/createProductAttributes.js deleted file mode 100644 index 54c645445bd..00000000000 --- a/cypress/e2e/configuration/attributes/createProductAttributes.js +++ /dev/null @@ -1,279 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { ATTRIBUTES_DETAILS } from "../../../elements/attribute/attributes_details"; -import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { attributeDetailsUrl, urlList } from "../../../fixtures/urlList"; -import { - createAttribute, - getAttribute, -} from "../../../support/api/requests/Attribute"; -import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData"; -import { - createAttributeWithInputType, - fillUpAttributeNameAndCode, -} from "../../../support/pages/attributesPage"; - -describe("As an admin I want to create product attribute", () => { - const startsWith = "AttrCreate" + Date.now(); - const attributesTypes = [ - { type: "MULTISELECT", testCase: "SALEOR_0502" }, - { type: "RICH_TEXT", testCase: "SALEOR_0504" }, - { type: "BOOLEAN", testCase: "SALEOR_0505" }, - { type: "DATE", testCase: "SALEOR_0523" }, - { type: "DATE_TIME", testCase: "SALEOR_0524" }, - ]; - const attributeReferenceType = [ - { type: "PRODUCT", testCase: "SALEOR_0506" }, - { type: "PAGE", testCase: "SALEOR_0507" }, - { type: "PRODUCT_VARIANT", testCase: "SALEOR_0540" }, - ]; - const attributeNumericType = [ - { - unitSystem: "IMPERIAL", - unitsOf: "DISTANCE", - unit: "FT", - testCase: "SALEOR_0508", - }, - { - unitSystem: "METRIC", - unitsOf: "VOLUME", - unit: "CUBIC_CENTIMETER", - testCase: "SALEOR_0509", - }, - { unitSystem: "without selecting unit", testCase: "SALEOR_0510" }, - ]; - - beforeEach(() => { - cy.loginUserViaRequest() - .visit(urlList.attributes) - .get(ATTRIBUTES_LIST.createAttributeButton) - .click(); - }); - - attributesTypes.forEach(attributeType => { - it( - `should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttributeWithInputType({ - name: attributeName, - attributeType: attributeType.type, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType: attributeType.type, - }); - }); - }, - ); - }); - - it( - `should be able to create FILE attribute. TC: SALEOR_0503`, - { tags: ["@attribute", "@allEnv", "@stable", "@oldRelease", "@critical"] }, - () => { - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttributeWithInputType({ - name: attributeName, - attributeType: "FILE", - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType: "FILE", - }); - }); - }, - ); - - attributeReferenceType.forEach(entityType => { - it( - `should be able to create ${entityType.type} attribute. TC:${entityType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "REFERENCE"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttributeWithInputType({ - name: attributeName, - attributeType, - entityType: entityType.type, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - entityType: entityType.type, - }); - }); - }, - ); - }); - - attributeNumericType.forEach(numericSystemType => { - it( - `should be able to create numeric ${numericSystemType.unitSystem} attribute. TC:${numericSystemType.testCase}`, - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "NUMERIC"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttributeWithInputType({ - name: attributeName, - attributeType, - numericSystemType, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - unit: numericSystemType.unit, - }); - }); - }, - ); - }); - - it( - "should be able to create attribute without require value. TC:SALEOR_0511", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "BOOLEAN"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttributeWithInputType({ - name: attributeName, - attributeType, - valueRequired: false, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - valueRequired: false, - }); - }); - }, - ); - - it( - "should create swatch attribute. TC:SALEOR_0531", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "SWATCH"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - createAttributeWithInputType({ - name: attributeName, - attributeType, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - valueRequired: true, - }); - }); - }, - ); - - it( - "should create swatch attribute with image. TC:SALEOR_0532", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeType = "SWATCH"; - const attributeName = `${startsWith}${faker.datatype.number()}`; - const swatchImage = "images/saleorDemoProductSneakers.png"; - createAttributeWithInputType({ - name: attributeName, - attributeType, - swatchImage, - }) - .then(({ attribute }) => { - getAttribute(attribute.id); - }) - .then(attribute => { - expectCorrectDataInAttribute(attribute, { - attributeName, - attributeType, - valueRequired: true, - }); - cy.get(ATTRIBUTES_DETAILS.swatchValueImage) - .invoke("attr", "style") - .should("include", "saleorDemoProductSneakers"); - }); - }, - ); - - it( - "should be able delete product attribute. TC:SALEOR_0525", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeName = `${startsWith}${faker.datatype.number()}`; - - createAttribute({ - name: attributeName, - }).then(attribute => { - cy.visit(attributeDetailsUrl(attribute.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("AttributeDelete") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@AttributeDelete"); - getAttribute(attribute.id).should("be.null"); - }); - }, - ); - - it( - "should be able update product attribute. TC:SALEOR_0526", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeName = `${startsWith}${faker.datatype.number()}`; - const attributeUpdatedName = `${startsWith}${faker.datatype.number()}`; - - createAttribute({ - name: attributeName, - }) - .then(attribute => { - cy.visit(attributeDetailsUrl(attribute.id)); - fillUpAttributeNameAndCode(attributeUpdatedName); - cy.addAliasToGraphRequest("AttributeUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@AttributeUpdate"); - getAttribute(attribute.id); - }) - .then(attribute => { - expect(attribute.name).to.eq(attributeUpdatedName); - expect(attribute.slug).to.eq(attributeUpdatedName); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js b/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js deleted file mode 100644 index 0947d061aa0..00000000000 --- a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js +++ /dev/null @@ -1,64 +0,0 @@ -// / -// / - -import faker from "faker"; - -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { attributeDetailsUrl } from "../../../fixtures/urlList"; -import { - createAttribute, - getAttribute, -} from "../../../support/api/requests/Attribute"; -import { - fillUpAttributeNameAndCode, -} from "../../../support/pages/attributesPage"; - -describe("As an admin I want to delete and update content attribute", () => { - const startsWith = "AttrContDel" + Date.now(); - let attribute; - - beforeEach(() => { - cy.loginUserViaRequest(); - createAttribute({ - name: `${startsWith}${faker.datatype.number()}`, - type: "PAGE_TYPE", - }).then(attributeResp => { - attribute = attributeResp; - }); - cy.checkIfDataAreNotNull(attribute); - }); - - it( - "should be able delete content attribute. TC:SALEOR_0529", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - cy.visit(attributeDetailsUrl(attribute.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("AttributeDelete") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@AttributeDelete"); - getAttribute(attribute.id).should("be.null"); - }, - ); - - it( - "should be able update content attribute. TC:SALEOR_0530", - { tags: ["@attribute", "@allEnv", "@stable"] }, - () => { - const attributeUpdatedName = `${startsWith}${faker.datatype.number()}`; - - cy.visit(attributeDetailsUrl(attribute.id)); - fillUpAttributeNameAndCode(attributeUpdatedName); - cy.addAliasToGraphRequest("AttributeUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@AttributeUpdate"); - getAttribute(attribute.id).then(attributeResp => { - expect(attributeResp.name).to.eq(attributeUpdatedName); - expect(attributeResp.slug).to.eq(attributeUpdatedName); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/attributes/filters.js b/cypress/e2e/configuration/attributes/filters.js deleted file mode 100644 index 5c5fedbf9f1..00000000000 --- a/cypress/e2e/configuration/attributes/filters.js +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// - -import { - getElementByDataTestId, - SHARED_ELEMENTS, -} from "../../../elements/shared/sharedElements"; -import { updateAttribute } from "../../../support/api/requests/Attribute"; -import { createProduct } from "../../../support/api/requests/Product"; -import { - createTypeAttributeAndCategoryForProduct, -} from "../../../support/api/utils/products/productsUtils"; -import { - enterAttributeAndChanegeIsFilterableInDashbord, -} from "../../../support/pages/attributesPage"; -import { - enterProductListPage, - selectAttributeFilter, - showFilters, -} from "../../../support/pages/catalog/products/productsListPage"; - -xdescribe("Tests for using attributes in filters", () => { - const startsWith = "AttrFilter" + Date.now(); - - let attribute; - - before(() => { - cy.loginUserViaRequest(); - createTypeAttributeAndCategoryForProduct({ - name: startsWith, - attributeValues: [startsWith], - }).then(({ attribute: attributeResp, category, productType }) => { - attribute = attributeResp; - createProduct({ - attributeId: attribute.id, - attributeValue: startsWith, - categoryId: category.id, - productTypeId: productType.id, - name: startsWith, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should use attribute as filter. TC: SALEOR_0601", - { tags: ["@attribute", "@allEnv"] }, - () => { - updateAttribute({ - attributeId: attribute.id, - filterableInDashboard: false, - }); - enterAttributeAndChanegeIsFilterableInDashbord(attribute.id); - enterProductListPage(); - selectAttributeFilter(attribute.slug, attribute.name); - cy.contains(SHARED_ELEMENTS.tableRow, attribute.name).should( - "be.visible", - ); - }, - ); - - it( - "should remove attribute from filters. TC: SALEOR_0602", - { tags: ["@attribute", "@allEnv"] }, - () => { - updateAttribute({ - attributeId: attribute.id, - filterableInDashboard: true, - }); - enterAttributeAndChanegeIsFilterableInDashbord(attribute.id); - enterProductListPage(); - showFilters(); - cy.get(getElementByDataTestId(attribute.name)).should("not.exist"); - }, - ); -}); diff --git a/cypress/e2e/configuration/channels/channels.js b/cypress/e2e/configuration/channels/channels.js deleted file mode 100644 index e749f022881..00000000000 --- a/cypress/e2e/configuration/channels/channels.js +++ /dev/null @@ -1,262 +0,0 @@ -/// -/// -import faker from "faker"; - -import { - ADD_CHANNEL_FORM_SELECTORS, -} from "../../../elements/channels/add-channel-form-selectors"; -import { - AVAILABLE_CHANNELS_FORM, -} from "../../../elements/channels/available-channels-form"; -import { - CHANNELS_SELECTORS, -} from "../../../elements/channels/channels-selectors"; -import { - SELECT_CHANNELS_TO_ASSIGN, -} from "../../../elements/channels/select-channels-to-assign"; -import { HEADER_SELECTORS } from "../../../elements/header/header-selectors"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { MESSAGES } from "../../../fixtures/"; -import { - productDetailsUrl, - urlList, -} from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { createChannel } from "../../../support/api/requests/Channels"; -import { getFirstProducts } from "../../../support/api/requests/Product"; -import { - createShippingZoneWithoutWarehouse, - getShippingZone, -} from "../../../support/api/requests/ShippingMethod"; -import { - createWarehouse as createWarehouseViaApi, -} from "../../../support/api/requests/Warehouse"; -import { - createChannelByView, - setChannelRequiredFields, - typeExpirationDays, -} from "../../../support/pages/channelsPage"; - -describe("Channels", () => { - const channelStartsWith = `CyChannels`; - const randomName = `${channelStartsWith}${faker.datatype.number()}`; - const currency = "PLN"; - let shippingZone; - let usAddress; - - before(() => { - cy.loginUserViaRequest(); - createShippingZoneWithoutWarehouse(randomName, "US").then( - shippingZoneResp => { - shippingZone = shippingZoneResp; - }, - ); - cy.fixture("addresses") - .then(addresses => { - usAddress = addresses.usAddress; - createWarehouseViaApi({ - name: randomName, - address: usAddress, - }); - }) - .then(warehouse => { - cy.checkIfDataAreNotNull({ shippingZone, usAddress, warehouse }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.channel); - }); - - it( - "should create new channel. TC: SALEOR_0701", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - cy.addAliasToGraphRequest("Channels"); - cy.visit(urlList.channels); - cy.expectSkeletonIsVisible(); - cy.waitForRequestAndCheckIfNoErrors("@Channels"); - createChannelByView({ name: randomChannel, currency }); - cy.waitForRequestAndCheckIfNoErrors("@Channel"); - - // New channel should be visible in channels list - cy.get(ADD_CHANNEL_FORM_SELECTORS.backToChannelsList) - .click() - .get(CHANNELS_SELECTORS.channelsTable) - .contains(randomChannel); - - // new channel should be visible in channel selector - cy.visit(urlList.homePage) - .get(HEADER_SELECTORS.channelSelect) - .click() - .get(HEADER_SELECTORS.channelSelectList) - .contains(randomChannel) - .click(); - - // new channel should be visible at product availability form - cy.clearSessionData().loginUserViaRequest(); - getFirstProducts(1).then(resp => { - const product = resp[0].node; - cy.visit(productDetailsUrl(product.id)) - .get(AVAILABLE_CHANNELS_FORM.manageChannelsButton) - .click() - .get(SELECT_CHANNELS_TO_ASSIGN.listOfChannels) - .contains(randomChannel); - }); - }, - ); - it( - "should create new channel with expired orders functionality set. TC: SALEOR_0713", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - const orderExpiresAfter = 120; - cy.addAliasToGraphRequest("Channels"); - cy.addAliasToGraphRequest("ChannelCreate"); - cy.visit(urlList.channels); - cy.waitForRequestAndCheckIfNoErrors("@Channels"); - setChannelRequiredFields({ name: randomChannel, currency }); - typeExpirationDays(orderExpiresAfter); - cy.clickConfirmButton(); - cy.waitForRequestAndCheckIfNoErrors("@ChannelCreate").then( - channelCreate => { - expect( - channelCreate.response.body.data.channelCreate.channel - .orderSettings, - ).to.have.property("deleteExpiredOrdersAfter", orderExpiresAfter); - cy.get(CHANNELS_SELECTORS.orderExpirationInput) - .invoke("val") - .should("contain", orderExpiresAfter.toString()); - }, - ); - }, - ); - it( - "should not be able to create new channel with expired orders functionality with values outside boundary conditions. TC: SALEOR_0714", - { tags: ["@channel", "@allEnv"] }, - () => { - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - const underBoundaryConditions = 0; - const overBoundaryConditions = 121; - cy.addAliasToGraphRequest("Channels"); - cy.addAliasToGraphRequest("ChannelCreate"); - cy.visit(urlList.channels); - cy.waitForRequestAndCheckIfNoErrors("@Channels"); - setChannelRequiredFields({ name: randomChannel, currency }); - typeExpirationDays(underBoundaryConditions); - - cy.clickConfirmButton(); - cy.wait("@ChannelCreate").then(createChannelResponse => { - cy.log(createChannelResponse); - expect( - createChannelResponse.response.body.data.channelCreate.errors.length, - ).to.eq(1); - cy.confirmationErrorMessageShouldAppear(); - }); - typeExpirationDays(overBoundaryConditions); - cy.clickConfirmButton(); - cy.wait("@ChannelCreate").then(createChannelResponse => { - cy.log(createChannelResponse); - expect( - createChannelResponse.response.body.data.channelCreate.errors.length, - ).to.eq(1); - cy.confirmationErrorMessageShouldAppear(); - }); - }, - ); - it( - "should create channel with shippingZone and warehouse TC: SALEOR_0712", - { tags: ["@channel", "@allEnv"] }, - () => { - // remove login after fixing SALEOR-3162 - cy.clearSessionData().loginUserViaRequest(); - - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - cy.addAliasToGraphRequest("Channels"); - cy.visit(urlList.channels); - cy.wait("@Channels"); - createChannelByView({ - name: randomChannel, - currency, - shippingZone: shippingZone.name, - warehouse: randomName, - }); - cy.waitForRequestAndCheckIfNoErrors("@Channel"); - getShippingZone(shippingZone.id).then(shippingZoneResp => { - const assignedChannel = shippingZoneResp.channels.find( - channel => channel.name === randomChannel, - ); - expect(assignedChannel).to.be.ok; - }); - }, - ); - - it( - "should validate that creating channels with same slug name as other is not possible. TC: SALEOR_0703", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - createChannel({ - isActive: false, - name: randomChannel, - slug: randomChannel, - currencyCode: currency, - }); - cy.visit(urlList.channels); - cy.expectSkeletonIsVisible(); - createChannelByView({ name: randomChannel, currency }); - cy.confirmationErrorMessageShouldAppear(); - cy.get(ADD_CHANNEL_FORM_SELECTORS.generalInformationSection).should( - "contain.text", - MESSAGES.slugMustBeUnique, - ); - }, - ); - - it( - "should validate not existing currency. TC: SALEOR_0704", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; - cy.visit(urlList.channels); - cy.expectSkeletonIsVisible(); - createChannelByView({ - name: randomChannel, - currency: "notExistingCurrency", - }); - cy.get(ADD_CHANNEL_FORM_SELECTORS.currencyValidationMessage).should( - "be.visible", - ); - }, - ); - - it( - "should delete channel. TC: SALEOR_0705", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannelToDelete = `${channelStartsWith} ${faker.datatype.number()}`; - createChannel({ - isActive: false, - name: randomChannelToDelete, - slug: randomChannelToDelete, - currencyCode: currency, - }); - cy.addAliasToGraphRequest("Channels"); - cy.visit(urlList.channels); - cy.expectSkeletonIsVisible(); - cy.wait("@Channels"); - cy.contains(CHANNELS_SELECTORS.channelName, randomChannelToDelete) - .parentsUntil(CHANNELS_SELECTORS.channelsTable) - .find("button") - .click(); - cy.addAliasToGraphRequest("Channels"); - cy.get(BUTTON_SELECTORS.submit).click(); - cy.waitForRequestAndCheckIfNoErrors("@Channels"); - - cy.get(CHANNELS_SELECTORS.channelName) - .contains(randomChannelToDelete) - .should("not.exist"); - }, - ); -}); diff --git a/cypress/e2e/configuration/channels/inactiveChannel.js b/cypress/e2e/configuration/channels/inactiveChannel.js deleted file mode 100644 index 33f79b4c9a7..00000000000 --- a/cypress/e2e/configuration/channels/inactiveChannel.js +++ /dev/null @@ -1,168 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - CHANNEL_FORM_SELECTORS, -} from "../../../elements/channels/channel-form-selectors"; -import { - DRAFT_ORDER_SELECTORS, -} from "../../../elements/orders/draft-order-selectors"; -import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors"; -import { urlList } from "../../../fixtures/urlList"; -import { - activateChannel, - createChannel, -} from "../../../support/api/requests/Channels"; -import { createCheckout } from "../../../support/api/requests/Checkout"; -import { - getProductDetails, -} from "../../../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../../support/api/utils/products/productsUtils"; -import { - isProductVisible, -} from "../../../support/api/utils/storeFront/storeFrontProductUtils"; - -describe("Tests on inactive channel", () => { - const channelStartsWith = `InactiveChannel`; - const randomName = `${channelStartsWith}${faker.datatype.number()}`; - const currency = "PLN"; - - let address; - let defaultChannel; - let newChannel; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("addresses").then(({ plAddress }) => { - address = plAddress; - }); - getDefaultChannel().then(channel => (defaultChannel = channel)); - createChannel({ - isActive: false, - name: randomName, - slug: randomName, - currencyCode: currency, - }).then(channel => { - newChannel = channel; - cy.checkIfDataAreNotNull({ address, defaultChannel, newChannel }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should not be possible to add products to order with inactive channel. TC: SALEOR_0706", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - cy.visit(urlList.orders) - .get(ORDERS_SELECTORS.createOrderButton) - .click() - .get(CHANNEL_FORM_SELECTORS.channelSelect) - .click() - .get(CHANNEL_FORM_SELECTORS.channelOption) - .contains(newChannel.name) - .click() - .get(CHANNEL_FORM_SELECTORS.confirmButton) - .click(); - cy.location() - .should(loc => { - const urlRegex = new RegExp(`${urlList.orders}.+`, "g"); - expect(loc.pathname).to.match(urlRegex); - }) - .get(DRAFT_ORDER_SELECTORS.addProducts) - .should("not.exist"); - }, - ); - - it( - "should not be possible to create checkout with inactive channel. TC: SALEOR_0707", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith}${faker.datatype.number()}`; - createTypeAttributeAndCategoryForProduct({ name: randomChannel }) - .then(({ productType, attribute, category }) => { - createProductInChannel({ - name: randomChannel, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }); - }) - .then(({ variantsList }) => { - createCheckout({ - channelSlug: newChannel.slug, - email: "example@example.com", - variantsList, - address, - }); - }) - .then(({ errors }) => { - expect( - errors[0], - "checkout shouldn't be created with error in field channel", - ).to.have.property("field", "channel"); - }); - }, - ); - - it( - "products in inactive channel should not be displayed. TC: SALEOR_0708", - { tags: ["@channel", "@allEnv", "@stable"] }, - () => { - const randomChannel = `${channelStartsWith}${faker.datatype.number()}`; - let channel; - let product; - - createChannel({ - isActive: false, - name: randomChannel, - slug: randomChannel, - currencyCode: currency, - }) - .then(channelResp => { - channel = channelResp; - createTypeAttributeAndCategoryForProduct({ name: randomChannel }); - }) - .then(({ productType, attribute, category }) => { - createProductInChannel({ - name: randomChannel, - channelId: channel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }); - }) - .then(({ product: productResp }) => { - product = productResp; - getProductDetails(product.id, channel.slug); - }) - .then(resp => { - const isVisible = isProductVisible(resp, randomChannel); - expect( - isVisible, - "product with inactive channel shouldn't be visible", - ).to.be.eq(false); - activateChannel(channel.id); - }) - .then(() => { - getProductDetails(product.id, channel.slug); - }) - .then(resp => { - const isVisible = isProductVisible(resp, randomChannel); - expect( - isVisible, - "product with active channel should be visible", - ).to.be.eq(true); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/customer.js b/cypress/e2e/configuration/customer.js deleted file mode 100644 index 7530ce9eb31..00000000000 --- a/cypress/e2e/configuration/customer.js +++ /dev/null @@ -1,297 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - CUSTOMER_DETAILS_SELECTORS, -} from "../../elements/customer/customer-details"; -import { - CUSTOMERS_LIST_SELECTORS, -} from "../../elements/customer/customers-list"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { - customerDetailsUrl, - urlList, -} from "../../fixtures/urlList"; -import { - addressCreate, - createCustomer, - getCustomer, -} from "../../support/api/requests/Customer"; - -describe("Tests for customer", () => { - const startsWith = `Customers`; - let address; - let secondAddress; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("addresses").then(({ usAddress, secondUsAddress }) => { - address = usAddress; - secondAddress = secondUsAddress; - }); - cy.checkIfDataAreNotNull({ address, secondAddress }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create customer. TC: SALEOR_1201", - { tags: ["@customer", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - const note = faker.lorem.paragraph(); - - cy.visit(urlList.customers) - .get(CUSTOMERS_LIST_SELECTORS.createCustomerButton) - .click() - .get(SHARED_ELEMENTS.progressBar) - .should("not.be.visible") - .get(CUSTOMER_DETAILS_SELECTORS.customerAddressNameInput) - .type(randomName) - .get(CUSTOMER_DETAILS_SELECTORS.customerAddressLastNameInput) - .type(randomName) - .get(CUSTOMER_DETAILS_SELECTORS.emailInput) - .type(email) - .fillUpAddressForm(address) - .get(CUSTOMER_DETAILS_SELECTORS.noteInput) - .type(note) - .addAliasToGraphRequest("CreateCustomer") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@CreateCustomer") - .its("response.body.data.customerCreate.user") - .then(customer => { - getCustomer(customer.id); - }) - .then(customer => { - expect(customer.firstName, "Expect correct first name").to.eq( - randomName, - ); - expect(customer.lastName, "Expect correct last name").to.eq( - randomName, - ); - expect(customer.email, "Expect correct email").to.eq( - email.toLowerCase(), - ); - expect(customer.note, "Expect correct note").to.eq(note); - cy.expectCorrectFullAddress(customer.addresses[0], address); - }); - }, - ); - - it( - "should add address to customer. TC: SALEOR_1204", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.manageAddressesButton) - .click() - .get(CUSTOMER_DETAILS_SELECTORS.addAddressButton) - .click() - .addAliasToGraphRequest("CreateCustomerAddress") - .fillUpAddressFormAndSubmit(secondAddress) - .waitForRequestAndCheckIfNoErrors("@CreateCustomerAddress"); - getCustomer(user.id).then(({ addresses }) => { - expect(addresses).to.have.length(1); - cy.expectCorrectFullAddress(addresses[0], secondAddress); - }); - }); - }, - ); - - it( - "should remove address from customer. TC: SALEOR_1205", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName, address).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.manageAddressesButton) - .click() - .waitForProgressBarToNotExist() - .get(BUTTON_SELECTORS.showMoreButton) - .should("be.enabled") - .first() - .click() - .get(CUSTOMER_DETAILS_SELECTORS.deleteAddressMenuItem) - .click() - .addAliasToGraphRequest("RemoveCustomerAddress") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@RemoveCustomerAddress"); - getCustomer(user.id).then(({ addresses }) => { - expect(addresses).to.have.length(1); - }); - }); - }, - ); - - it( - "should set address as default. TC: SALEOR_1206", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - let user; - - createCustomer(email, randomName) - .then(({ user: userResp }) => { - user = userResp; - addressCreate(user.id, address); - }) - .then(() => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.manageAddressesButton) - .click() - .waitForProgressBarToNotExist() - .get(BUTTON_SELECTORS.showMoreButton) - .should("be.enabled") - .click() - .addAliasToGraphRequest("SetCustomerDefaultAddress") - .get(CUSTOMER_DETAILS_SELECTORS.setAddressAsDefaultShipping) - .click() - .wait("@SetCustomerDefaultAddress"); - getCustomer(user.id); - }) - .then(({ addresses }) => { - expect(addresses[0].isDefaultShippingAddress).to.eq(true); - cy.get(BUTTON_SELECTORS.showMoreButton) - .should("be.enabled") - .click() - .addAliasToGraphRequest("SetCustomerDefaultAddress") - .get(CUSTOMER_DETAILS_SELECTORS.setAddressAsDefaultBilling) - .click() - .wait("@SetCustomerDefaultAddress"); - getCustomer(user.id); - }) - .then(({ addresses }) => { - expect(addresses[0].isDefaultBillingAddress).to.be.true; - }); - }, - ); - - it( - "should update address. TC: SALEOR_1208", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName, address).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.manageAddressesButton) - .click() - .get(BUTTON_SELECTORS.showMoreButton) - .should("be.enabled") - .first() - .click() - .get(CUSTOMER_DETAILS_SELECTORS.editAddressMenuitem) - .click() - .addAliasToGraphRequest("UpdateCustomerAddress") - .fillUpAddressFormAndSubmit(secondAddress) - .waitForRequestAndCheckIfNoErrors("@UpdateCustomerAddress"); - getCustomer(user.id).then(({ addresses }) => { - expect(addresses).to.have.length(2); - const addedAddress = addresses.find( - element => - element.city.toUpperCase() === secondAddress.city.toUpperCase(), - ); - cy.expectCorrectFullAddress(addedAddress, secondAddress); - }); - }); - }, - ); - - it( - "should delete customer. TC: SALEOR_1203", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName, address).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("RemoveCustomer") - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@RemoveCustomer"); - getCustomer(user.id).should("be.null"); - }); - }, - ); - - it( - "should deactivate customer. TC: SALEOR_1209", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName, address, true).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.activeCheckbox) - .click() - .addAliasToGraphRequest("UpdateCustomer") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@UpdateCustomer"); - getCustomer(user.id).then(({ isActive }) => { - expect(isActive).to.be.false; - }); - }); - }, - ); - - it( - "should update customer. TC: SALEOR_1202", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${randomName}UpdatedName`; - const email = `${randomName}@example.com`; - - createCustomer(email, randomName, address, true).then(({ user }) => { - cy.visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.nameInput) - .clear() - .type(updatedName) - .get(CUSTOMER_DETAILS_SELECTORS.lastNameInput) - .clearAndType(updatedName) - .get(CUSTOMER_DETAILS_SELECTORS.noteInput) - .clearAndType(updatedName) - .get(CUSTOMER_DETAILS_SELECTORS.emailInput) - .clear() - .type(`${updatedName}@example.com`) - .addAliasToGraphRequest("UpdateCustomer") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@UpdateCustomer"); - getCustomer(user.id).then(user => { - expect(user.firstName, "Expect correct first name").to.eq( - updatedName, - ); - expect(user.lastName, "Expect correct last name").to.eq(updatedName); - expect(user.email, "Expect correct email").to.eq( - `${updatedName}@example.com`.toLowerCase(), - ); - expect(user.note, "Expect correct note").to.eq(updatedName); - }); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/navigation.js b/cypress/e2e/configuration/navigation.js deleted file mode 100644 index c4c09290d94..00000000000 --- a/cypress/e2e/configuration/navigation.js +++ /dev/null @@ -1,81 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - createMenu as createMenuViaApi, - getMenu, -} from "../../support/api/requests/Menu"; -import { - createMenu, - createNewMenuItem, - MENU_ITEM_TYPES, -} from "../../support/pages/navigationPage"; - -describe("Tests for menu navigation", () => { - const startsWith = "Navigation"; - const randomName = `${startsWith}${faker.datatype.number()}`; - let testCase = 1301; - - let menu; - - before(() => { - cy.loginUserViaRequest(); - createMenuViaApi(randomName).then(({ menu: menuResp }) => { - menu = menuResp; - cy.checkIfDataAreNotNull(menu); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create a menu. TC: SALEOR_1301", - { tags: ["@menuNavigation", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createMenu(name) - .then(menuResp => { - getMenu(menuResp.id); - }) - .then(menuResp => { - expect(menuResp.name).to.eq(name); - }); - }, - ); - - ["category", "collection", "page"].forEach(itemType => { - testCase += 1; - it( - `should add new ${itemType} item to menu. TC: SALEOR_${testCase}`, - { tags: ["@menuNavigation", "@allEnv", "@stable"] }, - () => { - const itemName = `${startsWith}${faker.datatype.number()}`; - let selectedItem; - - cy.addAliasToGraphRequest("SearchCategories") - .addAliasToGraphRequest("SearchPages") - .addAliasToGraphRequest("SearchCollections"); - createNewMenuItem({ - menuId: menu.id, - name: itemName, - menuItemType: MENU_ITEM_TYPES[itemType], - }) - .then(selectedItemResp => { - selectedItem = selectedItemResp; - getMenu(menu.id); - }) - .then(({ items }) => { - const item = items.find(element => element.name === itemName); - const itemOfType = item[itemType]; - const name = itemType !== "page" ? "name" : "title"; - expect(itemOfType[name]).to.eq(selectedItem); - }); - }, - ); - }); -}); diff --git a/cypress/e2e/configuration/permissions.js b/cypress/e2e/configuration/permissions.js deleted file mode 100644 index 587f75cd075..00000000000 --- a/cypress/e2e/configuration/permissions.js +++ /dev/null @@ -1,169 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { PERMISSION_GROUP_DETAILS_SELECTORS } from "../../elements/permissionGroup/permissionGroupDetails"; -import { PERMISSION_GROUP_LIST_SELECTORS } from "../../elements/permissionGroup/permissionGroupsList"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { - permissionGroupDetails, - staffMemberDetailsUrl, - urlList, -} from "../../fixtures/urlList"; -import { TEST_ADMIN_USER } from "../../fixtures/users.js"; -import { - createPermissionGroup, - getPermissionGroup, -} from "../../support/api/requests/PermissionGroup.js"; -import { getStaffMembersStartsWith } from "../../support/api/requests/StaffMembers"; -import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas"; - -describe("Permissions groups", () => { - const startsWith = "CyPermissions-" + Date.now(); - const permissionManageProducts = "[MANAGE_PRODUCTS]"; - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create permission group. TC: SALEOR_1401", - { tags: ["@permissions", "@allEnv", "@stable"] }, - () => { - const permissionName = `${startsWith}${faker.datatype.number()}`; - cy.addAliasToGraphRequest("PermissionGroupCreate"); - cy.visit(urlList.permissionsGroups) - .get(PERMISSION_GROUP_LIST_SELECTORS.createPermissionButton) - .click() - .get(PERMISSION_GROUP_DETAILS_SELECTORS.nameInput) - .type(permissionName) - .get(PERMISSION_GROUP_DETAILS_SELECTORS.productsPermissionCheckbox) - .check() - .get( - PERMISSION_GROUP_DETAILS_SELECTORS.productsTypesAndAttributesPermissionCheckbox, - ) - .check() - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@PermissionGroupCreate") - .then(createPermissionRequest => { - const permissionGroupResponse = - createPermissionRequest.response.body.data.permissionGroupCreate; - expect(permissionGroupResponse.errors).to.have.length(0); - expect(permissionGroupResponse.group.name).to.contain(permissionName); - expect(permissionGroupResponse.group.permissions).to.have.length(2); - }); - }, - ); - - it( - "should delete permission group. TC: SALEOR_1402", - { tags: ["@permissions", "@allEnv", "@stable"] }, - () => { - const permissionName = `A-${startsWith}${faker.datatype.number()}`; - let staffMember; - cy.addAliasToGraphRequest("PermissionGroupDelete"); - getStaffMembersStartsWith(TEST_ADMIN_USER.email) - .its("body.data.staffUsers.edges") - .then(staffMemberResp => { - staffMember = staffMemberResp[0].node; - createPermissionGroup({ - name: permissionName, - userIdsArray: `["${staffMember.id}"]`, - permissionsArray: permissionManageProducts, - }).then(createPermissionGroupResponse => { - cy.visit( - urlList.permissionsGroups + - createPermissionGroupResponse.group.id, - ); - cy.contains(SHARED_ELEMENTS.header, permissionName); - cy.get(BUTTON_SELECTORS.deleteButton).click(); - cy.clickSubmitButton().waitForRequestAndCheckIfNoErrors( - "@PermissionGroupDelete", - ); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.get(SHARED_ELEMENTS.dataGridTable).should( - "not.contain.text", - permissionName, - ); - }); - }); - }, - ); - - it( - "should add user to permission group. TC: SALEOR_1403", - { tags: ["@permissions", "@allEnv", "@stable"] }, - () => { - const permissionName = `${startsWith}${faker.datatype.number()}`; - - createPermissionGroup({ - name: permissionName, - permissionsArray: permissionManageProducts, - }).then(({ group }) => { - cy.visit(permissionGroupDetails(group.id)) - .get(PERMISSION_GROUP_DETAILS_SELECTORS.assignMemberButton) - .click() - .get(PERMISSION_GROUP_DETAILS_SELECTORS.searchField) - .type(TEST_ADMIN_USER.email); - cy.contains( - PERMISSION_GROUP_DETAILS_SELECTORS.userRow, - `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`, - ) - .should("have.length", 1) - .find(BUTTON_SELECTORS.checkbox) - .check() - .get(BUTTON_SELECTORS.submit) - .click() - .addAliasToGraphRequest("PermissionGroupUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@PermissionGroupUpdate"); - getPermissionGroup(group.id) - .its("users") - .should("have.length", 1) - .its("0.email") - .should("eq", TEST_ADMIN_USER.email); - }); - }, - ); - - it( - "should remove user from permission group. TC: SALEOR_1404", - { tags: ["@permissions", "@allEnv", "@stable"] }, - () => { - const permissionName = `${startsWith}${faker.datatype.number()}`; - let staffMember; - - getStaffMembersStartsWith(TEST_ADMIN_USER.email) - .its("body.data.staffUsers.edges") - .then(staffMemberResp => { - staffMember = staffMemberResp[0].node; - - createPermissionGroup({ - name: permissionName, - userIdsArray: `["${staffMember.id}"]`, - permissionsArray: permissionManageProducts, - }); - }) - .then(({ group }) => { - cy.visit(permissionGroupDetails(group.id)) - .get(PERMISSION_GROUP_DETAILS_SELECTORS.removeUserButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .addAliasToGraphRequest("PermissionGroupUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@PermissionGroupUpdate"); - cy.visit(staffMemberDetailsUrl(staffMember.id)) - .get(SHARED_ELEMENTS.header) - .should("be.visible") - .contains(permissionName) - .should("not.exist"); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/plugins/adyen.js b/cypress/e2e/configuration/plugins/adyen.js deleted file mode 100644 index 4422698d11e..00000000000 --- a/cypress/e2e/configuration/plugins/adyen.js +++ /dev/null @@ -1,224 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - addShippingMethod, - completeCheckout, - createCheckout, -} from "../../../support/api/requests/Checkout"; -import { getOrder } from "../../../support/api/requests/Order"; -import { updatePlugin } from "../../../support/api/requests/Plugins"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - addAdyenPayment, - getShippingMethodIdFromCheckout, -} from "../../../support/api/utils/ordersUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../../support/api/utils/shippingUtils"; - -describe("Adyen payments", () => { - const startsWith = "Adyen"; - const name = startsWith + faker.datatype.number(); - const email = `example@example.com`; - - let address; - let defaultChannel; - let warehouse; - let shippingMethod; - let variantsList; - let checkout; - let paymentCards; - let cardData; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("cards").then(cardsResp => { - paymentCards = cardsResp.adyen; - cardData = { - clientData: paymentCards.clientData, - encryptedExpiryMonth: paymentCards.encryptedExpiryMonth, - encryptedExpiryYear: paymentCards.encryptedExpiryYear, - encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches, - }; - }); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createShipping({ - channelId: channelResp.id, - name, - address, - price: 10, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - }, - ) - .then(() => { - updatePlugin( - "mirumee.payments.adyen", - "adyen-auto-capture", - true, - defaultChannel.id, - ); - }); - createTypeAttributeAndCategoryForProduct({ name }) - .then(({ productType, attribute, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }); - }) - .then(({ variantsList: variants }) => { - variantsList = variants; - cy.checkIfDataAreNotNull({ - address, - defaultChannel, - warehouse, - shippingMethod, - variantsList, - checkout, - paymentCards, - cardData, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList, - address, - billingAddress: address, - auth: "token", - }) - .then(({ checkout: checkoutResp }) => { - const shippingMethodId = getShippingMethodIdFromCheckout( - checkoutResp, - shippingMethod.name, - ); - checkout = checkoutResp; - addShippingMethod(checkout.id, shippingMethodId); - }) - .then(({ checkout: checkoutResp }) => { - addAdyenPayment(checkout.id, checkoutResp.totalPrice.gross.amount); - }); - }); - - it( - "should purchase products with simple card", - { tags: ["@payments", "@allEnv"] }, - () => { - const simpleCard = cardData; - simpleCard.encryptedCardNumber = - paymentCards.cards.simpleCard.encryptedCardNumber; - simpleCard.brand = paymentCards.cards.simpleCard.brand; - completeCheckout(checkout.id, simpleCard) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect(order.paymentStatus).to.eq("FULLY_CHARGED"); - }); - }, - ); - - it( - "should purchase product with 3D secure 2 Auth", - { tags: ["@payments", "@allEnv"] }, - () => { - const threeDSecureCard = cardData; - threeDSecureCard.encryptedCardNumber = - paymentCards.cards.threeDSecureTwoAuth.encryptedCardNumber; - threeDSecureCard.brand = paymentCards.cards.threeDSecureTwoAuth.brand; - completeCheckout(checkout.id, threeDSecureCard) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect(order.paymentStatus).to.eq("FULLY_CHARGED"); - }); - }, - ); - - it( - "should purchase product with 3D secure 1 Auth", - { tags: ["@payments", "@allEnv"] }, - () => { - const threeDSecureCardOneAuth = cardData; - threeDSecureCardOneAuth.encryptedCardNumber = - paymentCards.cards.threeDSecureOneAuth.encryptedCardNumber; - threeDSecureCardOneAuth.brand = - paymentCards.cards.threeDSecureOneAuth.brand; - completeCheckout(checkout.id, threeDSecureCardOneAuth) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect(order.paymentStatus).to.eq("FULLY_CHARGED"); - }); - }, - ); - - it( - "should fail with unknown security number", - { tags: ["@payments", "@allEnv"] }, - () => { - const simpleCard = cardData; - simpleCard.encryptedCardNumber = - paymentCards.cards.simpleCard.encryptedCardNumber; - simpleCard.brand = paymentCards.cards.simpleCard.brand; - simpleCard.encryptedSecurityCode = - paymentCards.encryptedSecurityCodes.unknown; - completeCheckout(checkout.id, simpleCard).then(({ errors }) => { - expect(errors).to.have.length(1); - }); - }, - ); - - it( - "should fail with timeout in 3D authorization", - { tags: ["@payments", "@allEnv"] }, - () => { - const errorCard = cardData; - errorCard.encryptedCardNumber = - paymentCards.cards.errorCard.encryptedCardNumber; - errorCard.brand = paymentCards.cards.errorCard.brand; - completeCheckout(checkout.id, errorCard).then(({ errors }) => { - expect(errors).to.have.length(1); - }); - }, - ); - - it( - "should fail with closed account", - { tags: ["@payments", "@allEnv"] }, - () => { - const closeAccount = cardData; - closeAccount.encryptedCardNumber = - paymentCards.cards.closeAccount.encryptedCardNumber; - closeAccount.brand = paymentCards.cards.closeAccount.brand; - completeCheckout(checkout.id, closeAccount).then(({ errors }) => { - expect(errors).to.have.length(1); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/plugins/plugins.js b/cypress/e2e/configuration/plugins/plugins.js deleted file mode 100644 index 9a804e4ecdc..00000000000 --- a/cypress/e2e/configuration/plugins/plugins.js +++ /dev/null @@ -1,96 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { PLUGINS_DETAILS_SELECTORS } from "../../../elements/plugins/pluginDetails"; -import { PLUGINS_LIST_SELECTORS } from "../../../elements/plugins/pluginsList"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { urlList } from "../../../fixtures/urlList"; -import { - customerRegistration, - requestPasswordReset, -} from "../../../support/api/requests/Customer"; -import { activatePlugin } from "../../../support/api/requests/Plugins"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - getMailsForUser, - getMailWithResetPasswordLink, -} from "../../../support/api/utils/users"; - -describe("As an admin I want to manage plugins", () => { - const startsWith = "Plugins"; - const randomName = `${startsWith}${faker.datatype.number()}`; - - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel().then(channel => { - defaultChannel = channel; - activatePlugin({ id: "mirumee.notifications.admin_email" }); - activatePlugin({ - id: "mirumee.notifications.user_email", - channel: channel.id, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest().visit(urlList.plugins).expectSkeletonIsVisible(); - }); - - it( - "should change user email. TC: SALEOR_3601", - { tags: ["@plugins", "@allEnv", "@stable"] }, - () => { - const customerEmail = `${randomName}@example.com`; - - cy.contains(PLUGINS_LIST_SELECTORS.pluginRow, "User emails") - .click() - .waitForProgressBarToNotBeVisible(); - cy.contains(PLUGINS_DETAILS_SELECTORS.channel, defaultChannel.name) - .click() - .get(PLUGINS_DETAILS_SELECTORS.accountConfirmationSubjectInput) - .clearAndType(randomName) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - customerRegistration({ - email: customerEmail, - channel: defaultChannel.slug, - }) - .then(() => { - getMailsForUser(customerEmail) - .mpLatest() - .mpGetMailDetails() - .its("Subject"); - }) - .then(subject => { - expect(subject).to.eq(randomName); - }); - }, - ); - - it( - "should change admin email plugin. TC: SALEOR_3602", - { tags: ["@plugins", "@allEnv", "@stable"], browser: "chrome" }, - () => { - const adminName = `Admin${randomName}`; - - cy.contains(PLUGINS_LIST_SELECTORS.pluginRow, "Admin emails") - .click() - .get(PLUGINS_DETAILS_SELECTORS.staffPasswordResetInput) - .click() - .clear() - .clearAndType(adminName) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - requestPasswordReset(Cypress.env("USER_NAME"), defaultChannel.slug); - getMailWithResetPasswordLink(Cypress.env("USER_NAME"), adminName) - .its("Subject") - .should("contains", adminName); - }, - ); -}); diff --git a/cypress/e2e/configuration/plugins/stripe.js b/cypress/e2e/configuration/plugins/stripe.js deleted file mode 100644 index 89686c259af..00000000000 --- a/cypress/e2e/configuration/plugins/stripe.js +++ /dev/null @@ -1,170 +0,0 @@ -/// -/// -import faker from "faker"; - -import { - addShippingMethod, - completeCheckout, - createCheckout, -} from "../../../support/api/requests/Checkout"; -import { getOrder } from "../../../support/api/requests/Order"; -import { confirmThreeDSecure } from "../../../support/api/requests/stripe"; -import { - addStripePaymentAndGetConfirmationData, - getShippingMethodIdFromCheckout, -} from "../../../support/api/utils/ordersUtils"; -import { - createProductWithShipping, -} from "../../../support/api/utils/products/productsUtils"; - -describe("Stripe payments", () => { - const startsWith = "Stripe-" + faker.datatype.number(); - const email = `example@example.com`; - - let address; - let defaultChannel; - let shippingMethod; - let variantsList; - let checkout; - let paymentCards; - let cardData; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("cards").then(({ stripe }) => { - paymentCards = stripe; - cardData = { - publicKey: paymentCards.publicApiKey, - cvc: 123, - expMonth: 10, - expYear: 50, - }; - }); - createProductWithShipping({ name: startsWith }).then(values => { - address = values.address; - defaultChannel = values.defaultChannel; - shippingMethod = values.shippingMethod; - variantsList = values.variantsList; - cy.checkIfDataAreNotNull({ - address, - defaultChannel, - shippingMethod, - variantsList, - checkout, - paymentCards, - cardData, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList, - address, - billingAddress: address, - auth: "token", - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - const shippingMethodId = getShippingMethodIdFromCheckout( - checkoutResp, - shippingMethod.name, - ); - addShippingMethod(checkout.id, shippingMethodId); - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - }); - }); - - it( - "should purchase products with simple card", - { tags: ["@payments", "@allEnv"] }, - () => { - const simpleCard = cardData; - simpleCard.cardNumber = paymentCards.simpleCardNumber; - addStripePaymentAndGetConfirmationData({ - card: simpleCard, - checkoutId: checkout.id, - amount: checkout.totalPrice.gross.amount, - }) - .then(() => { - completeCheckout(checkout.id); - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect(order.paymentStatus).to.eq("FULLY_CHARGED"); - }); - }, - ); - - it( - "should not purchase products with card with insufficient funds", - { tags: ["@payments", "@allEnv"] }, - () => { - const simpleCard = cardData; - simpleCard.cardNumber = paymentCards.insufficientFundsCard; - addStripePaymentAndGetConfirmationData({ - card: simpleCard, - checkoutId: checkout.id, - amount: checkout.totalPrice.gross.amount, - }).then(resp => { - expect(resp.body.error.code).to.equal("card_declined"); - }); - }, - ); - - it( - "should purchase products with 3D secure card", - { tags: ["@payments", "@allEnv"] }, - () => { - const threeDSecureCard = cardData; - threeDSecureCard.cardNumber = paymentCards.threeDSecureAuthCard; - addStripePaymentAndGetConfirmationData({ - card: threeDSecureCard, - checkoutId: checkout.id, - amount: checkout.totalPrice.gross.amount, - }) - .then(resp => { - confirmThreeDSecure(resp.body.next_action.redirect_to_url.url); - }) - .then(() => { - completeCheckout(checkout.id); - }) - .then(({ order }) => { - getOrder(order.id); - }) - .then(order => { - expect(order.paymentStatus).to.eq("FULLY_CHARGED"); - }); - }, - ); - - it( - "should not purchase product when 3D secure not pass", - { tags: ["@payments", "@allEnv"] }, - () => { - const threeDSecureCard = cardData; - threeDSecureCard.cardNumber = paymentCards.threeDSecureAuthCard; - addStripePaymentAndGetConfirmationData({ - card: threeDSecureCard, - checkoutId: checkout.id, - amount: checkout.totalPrice.gross.amount, - }) - .then(resp => { - confirmThreeDSecure(resp.body.next_action.redirect_to_url.url, false); - }) - .then(() => { - completeCheckout(checkout.id); - }) - .then(({ order }) => { - expect(order).to.not.be.ok; - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js b/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js deleted file mode 100644 index 4e2061ae093..00000000000 --- a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js +++ /dev/null @@ -1,187 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - PRODUCT_TYPE_DETAILS_SELECTORS, -} from "../../../elements/productTypes/productTypeDetails"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { productTypeDetailsUrl } from "../../../fixtures/urlList"; -import { createAttribute } from "../../../support/api/requests/Attribute"; -import { - assignAttribute, - createTypeProduct, - getProductType, -} from "../../../support/api/requests/ProductType"; - -describe("As an admin I want to manage attributes in product types", () => { - const startsWith = "attrProdType"; - let attribute; - - before(() => { - cy.loginUserViaRequest(); - createAttribute({ name: startsWith }).then(resp => (attribute = resp)); - cy.checkIfDataAreNotNull(attribute); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to update product type with product attribute. TC: SALEOR_1503", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createTypeProduct({ name }) - .then(productType => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.assignProductAttributeButton) - .click() - .addAliasToGraphRequest("AssignProductAttribute") - .assignElements(startsWith) - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors("@AssignProductAttribute"); - getProductType(productType.id); - }) - .then(productType => { - expect(productType.productAttributes[0].name).to.eq(startsWith); - }); - }, - ); - - it( - "should be able to update product type with variant attribute. TC: SALEOR_1504", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createTypeProduct({ name, hasVariants: false }) - .then(productType => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.hasVariantsButton) - .should("be.enabled") - .click({ force: true }) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.assignVariantAttributeButton) - .click() - .addAliasToGraphRequest("AssignProductAttribute") - .assignElements(startsWith) - .confirmationMessageShouldAppear() - .wait("@AssignProductAttribute"); - getProductType(productType.id); - }) - .then(productType => { - expect(productType.assignedVariantAttributes[0].attribute.name).to.eq( - startsWith, - ); - }); - }, - ); - - it( - "should be able to remove variant attribute from product type. TC: SALEOR_1506", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - - createTypeProduct({ name, hasVariants: true }) - .then(productTypeResp => { - productType = productTypeResp; - assignAttribute(productType.id, attribute.id); - }) - .then(() => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.nameInput) - .should("be.enabled") - .get(BUTTON_SELECTORS.deleteIcon) - .should("be.enabled") - .click() - .addAliasToGraphRequest("UnassignProductAttribute") - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@UnassignProductAttribute"); - getProductType(productType.id); - }) - .then(productTypeResp => { - expect(productTypeResp.assignedVariantAttributes).to.be.empty; - }); - }, - ); - - it( - "should be able to remove product attribute from product type. TC: SALEOR_1507", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - - createTypeProduct({ name, hasVariants: false }) - .then(productTypeResp => { - productType = productTypeResp; - assignAttribute(productType.id, attribute.id, "PRODUCT"); - }) - .then(() => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.nameInput) - .should("be.enabled") - .get(BUTTON_SELECTORS.deleteIcon) - .should("be.enabled") - .click() - .addAliasToGraphRequest("UnassignProductAttribute") - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@UnassignProductAttribute"); - getProductType(productType.id); - }) - .then(productTypeResp => { - expect(productTypeResp.assignedVariantAttributes).to.be.empty; - }); - }, - ); - - it( - "should be able to select attribute as variant selection. TC: SALEOR_1508", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - - createTypeProduct({ name, hasVariants: true }) - .then(productTypeResp => { - productType = productTypeResp; - assignAttribute(productType.id, attribute.id); - }) - .then(() => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(PRODUCT_TYPE_DETAILS_SELECTORS.variantSelectionCheckbox) - .click() - .addAliasToGraphRequest("ProductAttributeAssignmentUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@ProductAttributeAssignmentUpdate"); - getProductType(productType.id); - }) - .then(productType => { - expect(productType.assignedVariantAttributes[0].attribute.name).to.eq( - startsWith, - ); - expect( - productType.assignedVariantAttributes[0].variantSelection, - ).to.eq(true); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/productTypes/createProductType.js b/cypress/e2e/configuration/productTypes/createProductType.js deleted file mode 100644 index 89ca3c6bd7a..00000000000 --- a/cypress/e2e/configuration/productTypes/createProductType.js +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../../fixtures/urlList"; -import { getProductType } from "../../../support/api/requests/ProductType"; -import { createProductType } from "../../../support/pages/productTypePage"; - -describe("As an admin I want to create product types", () => { - const startsWith = "productType"; - - beforeEach(() => { - cy.loginUserViaRequest() - .visit(urlList.productTypes) - .expectSkeletonIsVisible(); - }); - - it( - "should be able to create product type with gift card kind. TC: SALEOR_1510 - migration in progress - to delete when done", - { tags: ["@productType", "@allEnv", "@stable", "@critical"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createProductType({ name, giftCard: true }) - .then(productType => { - getProductType(productType.id); - }) - .then(productType => { - expect(productType.name).to.be.eq(name); - expect(productType.isShippingRequired).to.be.false; - expect(productType.kind).to.be.eq("GIFT_CARD"); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/productTypes/deleteProductType.js b/cypress/e2e/configuration/productTypes/deleteProductType.js deleted file mode 100644 index adffc7a1bf5..00000000000 --- a/cypress/e2e/configuration/productTypes/deleteProductType.js +++ /dev/null @@ -1,101 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { productTypeDetailsUrl } from "../../../fixtures/urlList"; -import { createAttribute } from "../../../support/api/requests/Attribute"; -import { createCategory } from "../../../support/api/requests/Category"; -import { - createTypeProduct, - getProductType, -} from "../../../support/api/requests/ProductType"; -import { - getProductDetails, -} from "../../../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createProductInChannel, -} from "../../../support/api/utils/products/productsUtils"; - -describe("As an admin I want to manage product types", () => { - const startsWith = "delProdType" + faker.datatype.number(); - let category; - let channel; - let attribute; - - before(() => { - cy.loginUserViaRequest(); - createAttribute({ name: startsWith }).then(resp => (attribute = resp)); - createCategory({ name: startsWith }).then(resp => (category = resp)); - getDefaultChannel().then(resp => { - channel = resp; - cy.checkIfDataAreNotNull({ attribute, channel, category }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to delete product type. TC: SALEOR_1505", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - createTypeProduct({ name, hasVariants: false }).then(productType => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("ProductTypeDelete") - .get(BUTTON_SELECTORS.confirmDeleteButton) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductTypeDelete"); - getProductType(productType.id).should("be.null"); - }); - }, - ); - - it( - "should be able to delete product type with assigned product. TC: SALEOR_1509", - { tags: ["@productType", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - - createTypeProduct({ name, hasVariants: false }) - .then(productTypeResp => { - productType = productTypeResp; - createProductInChannel({ - name, - channelId: channel.id, - categoryId: category.id, - productTypeId: productType.id, - }); - }) - .then(({ product }) => { - cy.visitAndWaitForProgressBarToDisappear( - productTypeDetailsUrl(productType.id), - ) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("ProductTypeDelete") - .get(BUTTON_SELECTORS.confirmDeleteButton) - .should("not.be.enabled") - .get(BUTTON_SELECTORS.deleteAssignedItemsConsentCheckbox) - .click() - .get(BUTTON_SELECTORS.confirmDeleteButton) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductTypeDelete"); - getProductType(productType.id).should("be.null"); - getProductDetails(product.id) - .its("body.data.product") - .should("be.null"); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/channelsInShipping.js b/cypress/e2e/configuration/shippingMethods/channelsInShipping.js deleted file mode 100644 index ba88d32aa58..00000000000 --- a/cypress/e2e/configuration/shippingMethods/channelsInShipping.js +++ /dev/null @@ -1,110 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; -import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details"; -import { urlList } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { createChannel } from "../../../support/api/requests/Channels"; -import { - addChannelToShippingMethod, - addChannelToShippingZone, -} from "../../../support/api/requests/ShippingMethod"; -import * as shippingUtils from "../../../support/api/utils/shippingUtils"; -import { selectChannelInHeader } from "../../../support/pages/channelsPage"; - -describe("As a staff user I want have different shipping method prices for each channel", () => { - const startsWith = "ChannelShippingMethod"; - let defaultChannel; - - it( - "should be able to display different price for each channel. TC: SALEOR_0805", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const shippingName = `${startsWith}${faker.datatype.number()}`; - const defaultChannelPrice = 11; - const createdChannelPrice = 7; - const createdChannelCurrency = "PLN"; - - let shippingMethod; - let shippingZone; - let createdChannel; - - cy.clearSessionData().loginUserViaRequest(); - - createChannel({ - name: shippingName, - currencyCode: createdChannelCurrency, - }).then(channel => { - createdChannel = channel; - }); - - shippingUtils - .createShippingWithDefaultChannel(shippingName, defaultChannelPrice) - .then( - ({ - shippingMethod: shippingMethodResp, - shippingZone: shippingZoneResp, - defaultChannel: defaultChannelResp, - }) => { - shippingZone = shippingZoneResp; - shippingMethod = shippingMethodResp; - defaultChannel = defaultChannelResp; - - addChannelToShippingZone(shippingZone.id, createdChannel.id).then( - () => { - addChannelToShippingMethod( - shippingMethod.id, - createdChannel.id, - createdChannelPrice, - ); - }, - ); - }, - ) - .then(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.shipping, - ); - cy.visit(`${urlList.shippingMethods}${shippingZone.id}`); - selectChannelInHeader(defaultChannel.name); - cy.waitForProgressBarToNotBeVisible() - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .getTextFromElement( - SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell, - ) - .then(text => { - const value = defaultChannelPrice - .toFixed(2) - .toString() - .split("."); - const valueRegex = new RegExp(value.join("(.|,)")); - expect(text).to.match(valueRegex); - expect(text).to.includes(defaultChannel.currencyCode); - selectChannelInHeader(createdChannel.name); - cy.waitForProgressBarToNotBeVisible() - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist"); - }) - .then(() => { - cy.getTextFromElement( - SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell, - ); - }) - .then(text => { - const value = createdChannelPrice - .toFixed(2) - .toString() - .split("."); - const valueRegex = new RegExp(value.join("(.|,)")); - expect(text).to.match(valueRegex); - expect(text).to.includes(createdChannelCurrency); - }); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js b/cypress/e2e/configuration/shippingMethods/createShippingMethod.js deleted file mode 100644 index 7da40cc6fc2..00000000000 --- a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js +++ /dev/null @@ -1,184 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { updateChannelWarehouses } from "../../../support/api/requests/Channels"; -import { createCheckout } from "../../../support/api/requests/Checkout"; -import { createVariant } from "../../../support/api/requests/Product"; -import { createWarehouse } from "../../../support/api/requests/Warehouse"; -import * as channelsUtils from "../../../support/api/utils/channelsUtils"; -import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils"; -import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils"; -import { - createShippingRate, - createShippingZone, - getDifferentDefaultWeight, - openChangeDefaultWeightDialog, - rateOptions, - selectDifferentDefaultWeight, -} from "../../../support/pages/shippingMethodPage"; - -describe("As a staff user I want to create shipping zone and rate", () => { - const startsWith = "CreateShippingMethods-"; - const name = `${startsWith}${faker.datatype.number()}`; - const secondName = `${startsWith}${faker.datatype.number()}`; - const price = 8; - const secondVariantPrice = 2; - const deliveryTime = { min: 2, max: 5 }; - let defaultChannel; - let address; - let variantsList; - let secondVariantsList; - let warehouse; - let attribute; - - before(() => { - const productTypeSlug = `${faker.lorem.slug()}slug`; - const productSlug = `${faker.lorem.slug()}slug`; - const warehouseSlug = `${faker.lorem.slug()}slug`; - cy.loginUserViaRequest(); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.usAddress; - - createWarehouse({ name, address, slug: warehouseSlug }); - }) - .then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: startsWith, - slug: productTypeSlug, - }); - }) - .then( - ({ - productType: productTypeResp, - category: categoryResp, - attribute: attributeResp, - }) => { - attribute = attributeResp; - - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id, - warehouseId: warehouse.id, - quantityInWarehouse: 10, - price, - slug: productSlug, - }); - }, - ) - .then(({ variantsList: variantsListResp, product }) => { - variantsList = variantsListResp; - createVariant({ - productId: product.id, - sku: secondName, - attributeId: attribute.id, - attributeName: "value2", - warehouseId: warehouse.id, - quantityInWarehouse: 10, - channelId: defaultChannel.id, - price: secondVariantPrice, - weight: 10, - }); - }) - .then(variantsListResp => { - secondVariantsList = variantsListResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - address, - warehouse, - variantsList, - secondVariantsList, - attribute, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to create weight based shipping method. TC: SALEOR_0804", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const shippingName = `${startsWith}${faker.datatype.number()}`; - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.shipping, - ); - cy.visit(urlList.shippingMethods); - createShippingZone( - shippingName, - warehouse.name, - address.countryFullName, - defaultChannel.name, - ); - createShippingRate({ - rateName: shippingName, - price, - rateOption: rateOptions.WEIGHT_OPTION, - deliveryTime, - weightLimits: { min: 5, max: 10 }, - }); - createWaitingForCaptureOrder({ - channelSlug: defaultChannel.slug, - email: "test@example.com", - variantsList: secondVariantsList, - address, - shippingMethodName: shippingName, - }) - .then(({ order }) => { - expect(order.id).to.be.ok; - createCheckout({ - channelSlug: defaultChannel.slug, - email: "test@example.com", - variantsList, - address, - auth: "token", - }); - }) - .then(({ checkout }) => { - const isShippingAvailable = isShippingAvailableInCheckout( - checkout, - shippingName, - ); - expect(isShippingAvailable).to.be.false; - }); - }, - ); - it( - "should be able to change default weight in shipping methods TC: SALEOR_4", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("ShopInfo"); - cy.clearSessionData().loginUserViaRequest(); - cy.visit(urlList.shippingMethods); - openChangeDefaultWeightDialog(); - getDifferentDefaultWeight().then(unit => { - selectDifferentDefaultWeight(unit) - .waitForRequestAndCheckIfNoErrors("@ShopInfo") - .then(resp => { - expect(resp.response.body.data.shop.defaultWeightUnit).equal(unit); - }); - }); - cy.confirmationMessageShouldAppear(); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js b/cypress/e2e/configuration/shippingMethods/editShippingMethod.js deleted file mode 100644 index 4ee38da0c81..00000000000 --- a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js +++ /dev/null @@ -1,123 +0,0 @@ -// / -// / - -import faker from "faker"; - -import { shippingRateUrl } from "../../../fixtures/urlList"; -import { - updateChannelWarehouses, -} from "../../../support/api/requests/Channels"; -import { - addChannelToShippingMethod, - createShippingRate, - createShippingZone, - getShippingZone, -} from "../../../support/api/requests/ShippingMethod"; -import { createWarehouse } from "../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - fillUpShippingRate, - saveRateAfterUpdate, -} from "../../../support/pages/shippingMethodPage"; - -describe("As a user I should be able to update and delete shipping method", () => { - const startsWith = "EditShipping-"; - const name = `${startsWith}${faker.datatype.number()}`; - const price = 10; - - let defaultChannel; - let shippingZone; - let shippingMethod; - let usAddress; - let warehouse; - - before(() => { - cy.loginUserViaRequest(); - - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - - cy.fixture("addresses"); - }) - .then(({ usAddress: usAddressResp }) => { - usAddress = usAddressResp; - - createWarehouse({ name, address: usAddress }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZone(name, "US", defaultChannel.id, warehouse.id).then( - shippingZoneResp => { - shippingZone = shippingZoneResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - shippingZone, - shippingMethod, - warehouse, - usAddress, - }); - }, - ); - }); - }); - }); - - beforeEach(() => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - createShippingRate({ - name: rateName, - shippingZone: shippingZone.id, - }).then(({ shippingMethod: shippingResp }) => { - shippingMethod = shippingResp; - addChannelToShippingMethod(shippingMethod.id, defaultChannel.id, 1); - }); - }); - - it( - "should be able to update shipping rate. TC: SALEOR_0806", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const updatedRateName = `${startsWith}Updated`; - const deliveryTime = { min: 1, max: 7 }; - - cy.visit(shippingRateUrl(shippingZone.id, shippingMethod.id)); - fillUpShippingRate({ - rateName: updatedRateName, - price, - deliveryTime, - }); - saveRateAfterUpdate(); - getShippingZone(shippingZone.id).then(({ shippingMethods }) => { - expect(shippingMethods).to.have.length(1); - expect(shippingMethods[0].minimumDeliveryDays).to.be.eq( - deliveryTime.min, - ); - expect(shippingMethods[0].maximumDeliveryDays).to.be.eq( - deliveryTime.max, - ); - expect(shippingMethods[0].channelListings[0].price.amount).to.be.eq( - price, - ); - }); - }, - ); - - it( - "should be able to delete shipping rate. TC: SALEOR_0807", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - cy.visit( - shippingRateUrl(shippingZone.id, shippingMethod.id), - ).deleteElementWithReqAlias("DeleteShippingRate"); - getShippingZone(shippingZone.id).then(({ shippingMethods }) => { - const deletedShipping = shippingMethods.find( - element => element.id === shippingMethod.id, - ); - expect(deletedShipping).to.be.not.ok; - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingZone.js b/cypress/e2e/configuration/shippingMethods/editShippingZone.js deleted file mode 100644 index f93d98cdc66..00000000000 --- a/cypress/e2e/configuration/shippingMethods/editShippingZone.js +++ /dev/null @@ -1,119 +0,0 @@ -// / -// / - -import faker from "faker"; - -import { MESSAGES } from "../../../fixtures/"; -import { shippingZoneDetailsUrl, urlList } from "../../../fixtures/urlList"; -import { updateChannelWarehouses } from "../../../support/api/requests/Channels"; -import { - createShippingZone, - getShippingZone, -} from "../../../support/api/requests/ShippingMethod"; -import { createWarehouse } from "../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { fillUpShippingZoneData } from "../../../support/pages/shippingMethodPage"; -import { typeShippingNameInSearch } from "../../../support/pages/shippingZones"; - -describe("As a user I should be able to update and delete shipping zone", () => { - const startsWith = "EditShippingZ-"; - const name = `${startsWith}${faker.datatype.number()}`; - - let defaultChannel; - let shippingZone; - let plAddress; - let warehouse; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - plAddress = addresses.plAddress; - createWarehouse({ name, address: plAddress }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - cy.checkIfDataAreNotNull({ - defaultChannel, - shippingZone, - plAddress, - warehouse, - }); - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - createShippingZone(name, "US", defaultChannel.id, warehouse.id).then( - shippingZoneResp => { - shippingZone = shippingZoneResp; - }, - ); - }); - - it( - "should be able to update shipping zone. TC: SALEOR_0808", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const updatedName = `${startsWith}Updated`; - - cy.visit(shippingZoneDetailsUrl(shippingZone.id)); - fillUpShippingZoneData({ - channelName: defaultChannel.name, - country: "Poland", - shippingName: updatedName, - warehouseName: name, - }); - getShippingZone(shippingZone.id).then(shippingZone => { - expect(shippingZone.channels).to.have.length(0); - expect(shippingZone.name).to.eq(updatedName); - expect(shippingZone.description).to.eq(updatedName); - expect(shippingZone.warehouses).to.have.length(0); - expect(shippingZone.countries.find(el => el.code === "PL")).to.be.ok; - }); - }, - ); - - it( - "should be able to delete shipping zone. TC: SALEOR_0809", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - cy.visit( - shippingZoneDetailsUrl(shippingZone.id), - ).deleteElementWithReqAlias("DeleteShippingZone"); - getShippingZone(shippingZone.id).should("be.null"); - }, - ); - - it( - "should be able to delete shipping zones on shipping zones list page. TC: SALEOR_0810", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const name = `${faker.datatype.number()}`; - let secondShippingZone; - cy.addAliasToGraphRequest("ShippingZones"); - cy.addAliasToGraphRequest("BulkDeleteShippingZone"); - createShippingZone( - `e2e-shippinig-zone-${name}`, - "US", - defaultChannel.id, - warehouse.id, - ).then(shippingZoneResp => { - secondShippingZone = shippingZoneResp; - cy.visit(urlList.shippingMethods); - typeShippingNameInSearch(shippingZone.name); - cy.deleteFirstRecordFromGridListAndValidate( - shippingZone.name, - "BulkDeleteShippingZone", - "ShippingZones", - ); - cy.contains(MESSAGES.noShippingZonesFound).should("be.visible"); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/postalCodes.js b/cypress/e2e/configuration/shippingMethods/postalCodes.js deleted file mode 100644 index 4d0918f7ddf..00000000000 --- a/cypress/e2e/configuration/shippingMethods/postalCodes.js +++ /dev/null @@ -1,158 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { shippingZoneDetailsUrl } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { - updateChannelWarehouses, -} from "../../../support/api/requests/Channels"; -import { createCheckout } from "../../../support/api/requests/Checkout"; -import { - createShippingZone, -} from "../../../support/api/requests/ShippingMethod"; -import { createWarehouse } from "../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../../support/api/utils/products/productsUtils"; -import { - isShippingAvailableInCheckout, -} from "../../../support/api/utils/storeFront/checkoutUtils"; -import { - createRateWithPostalCode, - postalCodesOptions, -} from "../../../support/pages/shippingMethodPage"; - -describe("As a user I want to create shipping method with postal codes", () => { - const startsWith = "postalCodes-"; - const name = `${startsWith}${faker.datatype.number()}`; - - const price = 10; - - let defaultChannel; - let usAddress; - let secondUsAddress; - let shippingZone; - let warehouse; - let variantsList; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - - cy.fixture("addresses"); - }) - .then( - ({ - usAddress: usAddressResp, - secondUsAddress: secondUsAddressResp, - }) => { - usAddress = usAddressResp; - secondUsAddress = secondUsAddressResp; - - createWarehouse({ name, address: usAddress }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZone( - name, - "US", - defaultChannel.id, - warehouse.id, - ).then(shippingZoneResp => { - shippingZone = shippingZoneResp; - - createTypeAttributeAndCategoryForProduct({ name }); - }); - }); - }, - ) - .then(({ attribute, productType, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - }); - }) - .then(({ variantsList: variantsListResp }) => { - variantsList = variantsListResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - usAddress, - secondUsAddress, - shippingZone, - warehouse, - variantsList, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping).visit( - shippingZoneDetailsUrl(shippingZone.id), - ); - }); - - it( - "should be able to create shipping method with included postal codes. TC: SALEOR_0801", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - createRateWithPostalCode({ - rateName, - price, - postalCodeOption: postalCodesOptions.INCLUDE_OPTION, - maxPostalCode: usAddress.postalCode, - minPostalCode: usAddress.postalCode, - }); - isShippingAvailableForAddress(usAddress, rateName).then( - isAvailable => expect(isAvailable).to.be.true, - ); - isShippingAvailableForAddress(secondUsAddress, rateName).then( - isAvailable => expect(isAvailable).to.be.false, - ); - }, - ); - - it( - "should be able to create shipping method with excluded postal codes. TC: SALEOR_0802", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - createRateWithPostalCode({ - rateName, - price, - postalCodeOption: postalCodesOptions.EXCLUDE_OPTION, - maxPostalCode: usAddress.postalCode, - minPostalCode: usAddress.postalCode, - }); - isShippingAvailableForAddress(usAddress, rateName).then( - isAvailable => expect(isAvailable).to.be.false, - ); - isShippingAvailableForAddress(secondUsAddress, rateName).then( - isAvailable => expect(isAvailable).to.be.true, - ); - }, - ); - - function isShippingAvailableForAddress(address, rateName) { - return createCheckout({ - address, - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList, - }).then(({ checkout }) => - isShippingAvailableInCheckout(checkout, rateName), - ); - } -}); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js deleted file mode 100644 index da601b52c80..00000000000 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js +++ /dev/null @@ -1,151 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { shippingZoneDetailsUrl } from "../../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../../fixtures/users"; -import { - updateChannelWarehouses, -} from "../../../../support/api/requests/Channels"; -import { createCheckout } from "../../../../support/api/requests/Checkout"; -import { - createShippingZone, -} from "../../../../support/api/requests/ShippingMethod"; -import { createWarehouse } from "../../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../../../support/api/utils/products/productsUtils"; -import { - isShippingAvailableInCheckout, -} from "../../../../support/api/utils/storeFront/checkoutUtils"; -import { - createShippingRate, - rateOptions, -} from "../../../../support/pages/shippingMethodPage"; - -describe("As a staff user I want to manage shipping weights", () => { - const startsWith = "weightsLimits"; - const name = `${startsWith}${faker.datatype.number()}`; - - const price = 10; - - let defaultChannel; - let usAddress; - let shippingZone; - let warehouse; - let variantsList; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - - cy.fixture("addresses"); - }) - .then(({ usAddress: usAddressResp }) => { - usAddress = usAddressResp; - - createWarehouse({ name, address: usAddress }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZone(name, "US", defaultChannel.id, warehouse.id).then( - shippingZoneResp => { - shippingZone = shippingZoneResp; - - createTypeAttributeAndCategoryForProduct({ name }); - }, - ); - }); - }) - .then(({ attribute, productType, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - weight: 10, - }); - }) - .then(({ variantsList: variantsListResp }) => { - variantsList = variantsListResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - usAddress, - shippingZone, - warehouse, - variantsList, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping).visit( - shippingZoneDetailsUrl(shippingZone.id), - ); - }); - - it( - "should be possible to buy product in a shipping weight limits. TC: SALEOR_0902", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - createShippingRate({ - rateName, - price, - rateOption: rateOptions.WEIGHT_OPTION, - weightLimits: { - max: 11, - min: 10, - }, - }) - .then(() => { - createCheckout({ - address: usAddress, - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList, - }); - }) - .then(({ checkout }) => { - expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.true; - }); - }, - ); - - it( - "should not be possible to buy product not in a shipping weight limits. TC: SALEOR_0903", - { tags: ["@shipping", "@allEnv", "@stable"] }, - () => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - createShippingRate({ - rateName, - price, - rateOption: rateOptions.WEIGHT_OPTION, - weightLimits: { - max: 101, - min: 100, - }, - }) - .then(() => { - createCheckout({ - address: usAddress, - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList, - }); - }) - .then(({ checkout }) => { - expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.false; - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js deleted file mode 100644 index 36379625afb..00000000000 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js +++ /dev/null @@ -1,123 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements"; -import { - SHIPPING_RATE_DETAILS, -} from "../../../../elements/shipping/shipping-rate-details"; -import { - shippingRateUrl, - urlList, -} from "../../../../fixtures/urlList"; -import { - updateChannelWarehouses, -} from "../../../../support/api/requests/Channels"; -import { - createShippingRate as createShippingRateViaApi, - createShippingZone, -} from "../../../../support/api/requests/ShippingMethod"; -import { - updateShopWeightUnit, -} from "../../../../support/api/requests/ShopSettings"; -import { createWarehouse } from "../../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils"; -import { changeWeightUnit } from "../../../../support/pages/shippingMethodPage"; - -describe("As a staff user I want to change shop default weight unit", () => { - const startsWith = "RecalculateWeight"; - const name = `${startsWith}${faker.datatype.number()}`; - - let defaultChannel; - let usAddress; - let shippingZone; - let warehouse; - - before(() => { - cy.loginUserViaRequest(); - updateShopWeightUnit("KG") - .then(() => { - getDefaultChannel().then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }); - }) - .then(({ usAddress: usAddressResp }) => { - usAddress = usAddressResp; - - createWarehouse({ name, address: usAddress }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZone(name, "US", defaultChannel.id, warehouse.id); - }); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - usAddress, - shippingZone, - warehouse, - }); - }); - }); - - xit( - "should recalculate weight after changing shipping weight unit. TC: SALEOR_0901", - { tags: ["@shipping", "@allEnv"] }, - () => { - // Enable this test after fixing SALEOR-4898 - - const rateName = `${startsWith}${faker.datatype.number()}`; - const minWeightInKg = 1; - const maxWeightInKg = 10; - const minWeightInG = minWeightInKg * 1000; - const maxWeightInG = maxWeightInKg * 1000; - let shippingMethod; - - cy.clearSessionData().loginUserViaRequest(); - - createShippingRateViaApi({ - name: rateName, - shippingZone: shippingZone.id, - type: "WEIGHT", - maxWeight: maxWeightInKg, - minWeight: minWeightInKg, - }) - .then(({ shippingMethod: shippingMethodResp }) => { - shippingMethod = shippingMethodResp; - cy.visit(urlList.shippingMethods) - .get(SHARED_ELEMENTS.progressBar) - .should("not.exist"); - changeWeightUnit("G"); - - cy.addAliasToGraphRequest("ShippingZone"); - cy.visit(shippingRateUrl(shippingZone.id, shippingMethod.id)) - .wait("@ShippingZone") - .its("response.body"); - }) - .then(responseArray => { - const shippingMethods = - responseArray.data.shippingZone.shippingMethods; - const rate = shippingMethods.find( - element => element.id === shippingMethod.id, - ); - cy.waitForProgressBarToNotBeVisible(); - expect(rate.minimumOrderWeight.unit).to.eq("G"); - cy.get(SHIPPING_RATE_DETAILS.restrictWeightLimitCheckbox) - .click() - .get(SHIPPING_RATE_DETAILS.minValueInput) - .invoke("val"); - }) - .then(actualMinWeight => { - expect(parseInt(actualMinWeight, 10)).to.eq(minWeightInG); - cy.get(SHIPPING_RATE_DETAILS.maxValueInput).invoke("val"); - }) - .then(actualMaxWeight => { - expect(parseInt(actualMaxWeight, 10)).to.eq(maxWeightInG); - }); - }, - ); -}); diff --git a/cypress/e2e/configuration/siteSettings.js b/cypress/e2e/configuration/siteSettings.js deleted file mode 100644 index daf7b869605..00000000000 --- a/cypress/e2e/configuration/siteSettings.js +++ /dev/null @@ -1,34 +0,0 @@ -/// -/// - -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { urlList } from "../../fixtures/urlList"; -import { updateShopAddress } from "../../support/api/requests/ShopSettings"; - -describe("Tests for site settings", () => { - let address; - - before(() => { - cy.loginUserViaRequest(); - - cy.fixture("addresses").then(({ usAddress, plAddress }) => { - address = usAddress; - updateShopAddress(plAddress); - cy.checkIfDataAreNotNull(address); - }); - }); - - it( - "should change store address", - { tags: ["@siteSettings", "@allEnv", "@stable"] }, - () => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.siteSettings) - .fillUpBasicAddress(address) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - }, - ); -}); diff --git a/cypress/e2e/configuration/warehouses/warehouse.js b/cypress/e2e/configuration/warehouses/warehouse.js deleted file mode 100644 index 9e18a39546f..00000000000 --- a/cypress/e2e/configuration/warehouses/warehouse.js +++ /dev/null @@ -1,211 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details"; -import { WAREHOUSES_DETAILS } from "../../../elements/warehouses/warehouse-details"; -import { WAREHOUSES_LIST } from "../../../elements/warehouses/warehouses-list"; -import { - shippingZoneDetailsUrl, - urlList, - warehouseDetailsUrl, -} from "../../../fixtures/urlList"; -import { updateChannelWarehouses } from "../../../support/api/requests/Channels"; -import { - createShippingZone, - createShippingZoneWithoutWarehouse, -} from "../../../support/api/requests/ShippingMethod"; -import { - createWarehouse as createWarehouseViaApi, - getWarehouse, -} from "../../../support/api/requests/Warehouse"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; - -describe("As an admin I want to manage warehouses", () => { - const startsWith = "CyWarehouse"; - let usAddress; - let secondUsAddress; - - before(() => { - cy.loginUserViaRequest(); - cy.fixture("addresses").then(addresses => { - usAddress = addresses.usAddress; - secondUsAddress = addresses.secondUsAddress; - cy.checkIfDataAreNotNull({ usAddress, secondUsAddress }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to create warehouse. TC: SALEOR_1101", - { tags: ["@warehouse", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - cy.visit(urlList.warehouses) - .get(WAREHOUSES_LIST.createNewButton) - .click() - .get(WAREHOUSES_DETAILS.nameInput) - .type(name) - .fillUpBasicAddress(usAddress) - .addAliasToGraphRequest("WarehouseCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseCreate") - .its("response.body.data.createWarehouse.warehouse") - .then(warehouse => { - getWarehouse(warehouse.id); - }) - .then(warehouse => { - const addressResp = warehouse.address; - expect(warehouse.name).to.be.eq(name); - cy.expectCorrectBasicAddress(addressResp, usAddress); - }); - }, - ); - - it( - "should be able to add warehouse to shipping zone. TC: SALEOR_1102", - { tags: ["@warehouse", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let warehouse; - let shippingZone; - - getDefaultChannel() - .then(channelResp => { - defaultChannel = channelResp; - - createWarehouseViaApi({ - name, - address: usAddress, - }); - }) - .then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZoneWithoutWarehouse(name, "US", defaultChannel.id); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - - cy.visit(shippingZoneDetailsUrl(shippingZone.id)) - .fillAutocompleteSelect( - SHIPPING_ZONE_DETAILS.warehouseSelector, - warehouse.name, - ) - .addAliasToGraphRequest("UpdateShippingZone") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@UpdateShippingZone"); - getWarehouse(warehouse.id); - }) - .then(warehouseResp => { - expect(warehouseResp.shippingZones.edges[0].node.id).to.be.eq( - shippingZone.id, - ); - }); - }, - ); - - it( - "should be able to delete warehouse. TC: SALEOR_1103", - { tags: ["@warehouse", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - createWarehouseViaApi({ - name, - address: usAddress, - }).then(warehouse => { - cy.visit(warehouseDetailsUrl(warehouse.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("WarehouseDelete") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseDelete"); - getWarehouse(warehouse.id).should("be.null"); - }); - }, - ); - - it( - "should be able to remove warehouse from shipping zone. TC: SALEOR_1104", - { tags: ["@warehouse", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let warehouse; - let shippingZone; - - getDefaultChannel() - .then(channelResp => { - defaultChannel = channelResp; - - createWarehouseViaApi({ - name, - address: usAddress, - }).then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(defaultChannel.id, warehouse.id); - createShippingZone(name, "US", defaultChannel.id, warehouse.id); - }); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - - cy.visit(shippingZoneDetailsUrl(shippingZone.id)) - .get(SHIPPING_ZONE_DETAILS.removeWarehouseButton) - .click() - .addAliasToGraphRequest("UpdateShippingZone") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@UpdateShippingZone"); - getWarehouse(warehouse.id).then(warehouseResp => { - expect(warehouseResp.shippingZones.edges).to.be.empty; - }); - }); - }, - ); - - it( - "should be able to update warehouse. TC: SALEOR_1105", - { tags: ["@warehouse", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}${faker.datatype.number()}`; - let warehouse; - - createWarehouseViaApi({ - name, - address: usAddress, - }) - .then(warehouseResp => { - warehouse = warehouseResp; - cy.visit(warehouseDetailsUrl(warehouse.id)) - .get(WAREHOUSES_DETAILS.nameInput) - .clear() - .type(updatedName) - // .clearAndType(updatedName) - .fillUpBasicAddress(secondUsAddress) - .addAliasToGraphRequest("WarehouseUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseUpdate"); - getWarehouse(warehouse.id); - }) - .then(warehouseResp => { - const addressResp = warehouseResp.address; - expect(warehouseResp.name).to.be.eq(updatedName); - cy.expectCorrectBasicAddress(addressResp, secondUsAddress); - }); - }, - ); -}); diff --git a/cypress/e2e/customerRegistration.js b/cypress/e2e/customerRegistration.js deleted file mode 100644 index 400bb820cd6..00000000000 --- a/cypress/e2e/customerRegistration.js +++ /dev/null @@ -1,110 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { CUSTOMER_DETAILS_SELECTORS } from "../elements/customers/customer-details"; -import { BUTTON_SELECTORS } from "../elements/shared/button-selectors"; -import { customerDetailsUrl } from "../fixtures/urlList"; -import { - confirmAccount, - customerRegistration, -} from "../support/api/requests/Customer"; -import { getDefaultChannel } from "../support/api/utils/channelsUtils"; -import { getMailActivationLinkForUser } from "../support/api/utils/users"; - -describe("Tests for customer registration", () => { - const startsWith = "Registration"; - const email = `${startsWith}${faker.datatype.number()}@example.com`; - - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel().then(channel => { - defaultChannel = channel; - cy.checkIfDataAreNotNull({ defaultChannel }); - }); - }); - - it( - "should register customer TC: SALEOR_1212", - { tags: ["@customer", "@allEnv"] }, - () => { - const email = `${startsWith}${faker.datatype.number()}@example.com`; - customerRegistration({ email, channel: defaultChannel.slug }); - const registrationLinkRegex = /\[(\s*http[^\]]*)\]/; - getMailActivationLinkForUser(email, registrationLinkRegex) - .then(urlLink => { - const tokenRegex = /token=(.*)/; - const token = urlLink.match(tokenRegex)[1]; - cy.clearSessionData(); - confirmAccount(email, token); - }) - .then(() => { - cy.loginUserViaRequest("token", { - email, - password: Cypress.env("USER_PASSWORD"), - }).its("body.data.tokenCreate"); - }) - .then(({ errors, token }) => { - expect(errors.length).to.eq(0); - expect(token).to.be.ok; - }); - }, - ); - - it( - "shouldn't register customer with duplicated email TC: SALEOR_1213", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - const duplicatedEmail = Cypress.env("USER_NAME"); - customerRegistration({ - duplicatedEmail, - channel: defaultChannel.slug, - }).then(({ user, errors }) => { - expect(errors[0].field).to.eq("email"); - expect(user).to.not.be.ok; - }); - }, - ); - - it( - "should activate customer from dashboard SALEOR_1211", - { tags: ["@customer", "@allEnv", "@stable"] }, - () => { - customerRegistration({ email, channel: defaultChannel.slug }) - .then(({ user }) => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(customerDetailsUrl(user.id)) - .get(CUSTOMER_DETAILS_SELECTORS.isActiveCheckbox) - .click() - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .then(() => { - const registrationLinkRegex = /\[(\s*http[^\]]*)\]/; - getMailActivationLinkForUser(email, registrationLinkRegex).then( - urlLink => { - const tokenRegex = /token=(.*)/; - const token = urlLink.match(tokenRegex)[1]; - cy.clearSessionData(); - confirmAccount(email, token); - }, - ); - }) - .clearSessionData() - .loginUserViaRequest("token", { - email, - password: Cypress.env("USER_PASSWORD"), - }) - .its("body.data.tokenCreate"); - }) - .then(({ token, errors }) => { - expect(errors.length).to.eq(0); - expect(token).to.be.ok; - }); - }, - ); -}); diff --git a/cypress/e2e/demo/demoDashboard.js b/cypress/e2e/demo/demoDashboard.js deleted file mode 100644 index 4c22e74db4b..00000000000 --- a/cypress/e2e/demo/demoDashboard.js +++ /dev/null @@ -1,43 +0,0 @@ -/// -/// -import { - BUTTON_SELECTORS, - HOMEPAGE_SELECTORS, - SHARED_ELEMENTS, -} from "../../elements"; -import { orderDraftCreateDemoResponse, urlList } from "../../fixtures"; -import { ordersOperationsHelpers } from "../../support/pages"; - -describe("Dashboard demo site tests", () => { - it("should be able to log in via UI", { tags: ["@demo-dashboard"] }, () => { - cy.addAliasToGraphRequest("Home") - .visit("/") - .get(BUTTON_SELECTORS.submit) - .should("be.visible") - .click() - .waitForRequestAndCheckIfNoErrors("@Home"); - cy.get(SHARED_ELEMENTS.notificationMessage).should("have.length", 1); - cy.get(HOMEPAGE_SELECTORS.welcomeMessage).should("be.visible"); - cy.get(SHARED_ELEMENTS.notificationMessage).should("not.exist"); - }); - it( - "should not be able to create new order", - { tags: ["@demo-dashboard"] }, - () => { - cy.addAliasToGraphRequest("OrderList"); - cy.loginUserViaRequest().then(() => { - cy.visit(`${urlList.orders}`).waitForRequestAndCheckIfNoErrors( - "@OrderList", - ); - ordersOperationsHelpers.pickAndSelectChannelOnCreateOrderFormByIndex(1); - cy.addAliasToGraphRequest("OrderDraftCreate") - .clickSubmitButton() - .waitForRequestAndErrorMessage( - "@OrderDraftCreate", - orderDraftCreateDemoResponse, - ); - cy.get(SHARED_ELEMENTS.notificationMessage).should("exist"); - }); - }, - ); -}); diff --git a/cypress/e2e/discounts/sales/createSalesForProducts.js b/cypress/e2e/discounts/sales/createSalesForProducts.js deleted file mode 100644 index 04dc288e938..00000000000 --- a/cypress/e2e/discounts/sales/createSalesForProducts.js +++ /dev/null @@ -1,184 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../../fixtures/urlList"; -import { createChannel } from "../../../support/api/requests/Channels"; -import { updateChannelInProduct } from "../../../support/api/requests/Product"; -import * as channelsUtils from "../../../support/api/utils/channelsUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../../support/api/utils/shippingUtils"; -import { - getProductPrice, -} from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import { - getDefaultTaxClass, - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/taxesUtils"; -import { - assignProducts, - createSale, - createSaleWithNewProduct, - discountOptions, -} from "../../../support/pages/discounts/salesPage"; - -describe("As an admin I want to create sale for products", () => { - const startsWith = "SalesProd-"; - const discountValue = 50; - const productPrice = 100; - - let productType; - let attribute; - let category; - let defaultChannel; - let warehouse; - let taxClass; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp, - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - - channelsUtils.getDefaultChannel(); - }, - ) - .then(channel => { - defaultChannel = channel; - getDefaultTaxClass(); - }) - .then(taxResp => { - taxClass = taxResp; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: defaultChannel.id, - name, - address: addresses.plAddress, - price: 100, - taxClassId: taxClass.id, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - cy.checkIfDataAreNotNull({ - productType, - attribute, - category, - defaultChannel, - warehouse, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - - it( - "should be able to create percentage discount. TC: SALEOR_1801", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - const expectedPrice = (productPrice * discountValue) / 100; - - createSaleWithNewProduct({ - name: saleName, - channel: defaultChannel, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice, - discountOption: discountOptions.PERCENTAGE, - discountValue, - taxClassId: taxClass.id, - }).should("eq", expectedPrice); - }, - ); - - it( - "should be able to create fixed price discount. TC: SALEOR_1802", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - const expectedPrice = productPrice - discountValue; - - createSaleWithNewProduct({ - name: saleName, - channel: defaultChannel, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice, - discountOption: discountOptions.FIXED, - discountValue, - }).should("eq", expectedPrice); - }, - ); - - it( - "should not be able to see product discount not assign to channel. TC: SALEOR_1803", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - - let channel; - let product; - - createChannel({ name: saleName }).then( - channelResp => (channel = channelResp), - ); - productsUtils - .createProductInChannel({ - name: saleName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice, - taxClassId: taxClass.id, - }) - .then(({ product: productResp }) => { - product = productResp; - - updateChannelInProduct({ - productId: product.id, - channelId: channel.id, - }); - /* Uncomment after fixing SALEOR-3367 bug - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) - */ - cy.visit(urlList.sales); - createSale({ - saleName, - channelName: channel.name, - discountValue, - }); - assignProducts(product.name); - getProductPrice(product.id, defaultChannel.slug); - }) - .should("eq", productPrice); - }, - ); -}); diff --git a/cypress/e2e/discounts/sales/createSalesForVariants.js b/cypress/e2e/discounts/sales/createSalesForVariants.js deleted file mode 100644 index 5454a360d7e..00000000000 --- a/cypress/e2e/discounts/sales/createSalesForVariants.js +++ /dev/null @@ -1,214 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { createCheckout } from "../../../support/api/requests/Checkout"; -import { updateSale } from "../../../support/api/requests/Discounts/Sales"; -import { createVariant } from "../../../support/api/requests/Product"; -import * as channelsUtils from "../../../support/api/utils/channelsUtils"; -import { - createSaleInChannel, - getVariantWithSaleStatus, -} from "../../../support/api/utils/discounts/salesUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../../support/api/utils/shippingUtils"; -import { - getDefaultTaxClass, - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/taxesUtils"; -import { - createSaleWithNewVariant, - discountOptions, -} from "../../../support/pages/discounts/salesPage"; - -describe("Sales discounts for variant", () => { - const startsWith = "SalesVar-"; - const discountValue = 50; - const productPrice = 100; - - let defaultChannel; - let warehouse; - let productData; - let address; - let taxClass; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - getDefaultTaxClass(); - }) - .then(taxResp => { - taxClass = taxResp; - }); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - - createShipping({ - channelId: defaultChannel.id, - address, - name, - taxClassId: taxClass.id, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - }); - productsUtils - .createTypeAttributeAndCategoryForProduct({ - name, - attributeValues: ["value1", "value2"], - }) - .then(({ attribute, category, productType }) => { - productData = { - attributeId: attribute.id, - attributeName: attribute.name, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - price: productPrice, - taxClassId: taxClass.id, - }; - cy.checkIfDataAreNotNull({ - productData, - defaultChannel, - warehouse, - address, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - - it( - "should not be able see product variant discount not assigned to channel. TC: SALEOR_1804", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - const variantSku = `${startsWith}${faker.datatype.number()}`; - const productSku = `${startsWith}${faker.datatype.number()}`; - const productName = faker.commerce.product(); - const productSlug = productName + faker.datatype.number(); - const productPriceOnSale = productPrice - discountValue; - - let sale; - let variantNotOnSale; - - createSaleInChannel({ - name: saleName, - type: "FIXED", - value: discountValue, - channelId: defaultChannel.id, - }).then(saleResp => (sale = saleResp)); - productsUtils - .createProductInChannel({ - ...productData, - name: productName, - slug: productSlug, - sku: productSku, - }) - .then(({ product, variantsList }) => { - variantNotOnSale = variantsList; - - createVariant({ - productId: product.id, - sku: variantSku, - attributeId: productData.attributeId, - attributeName: "value2", - warehouseId: warehouse.id, - quantityInWarehouse: 10, - channelId: defaultChannel.id, - price: productPrice, - weight: 10, - }); - }) - .then(variantsList => { - updateSale({ saleId: sale.id, variants: variantsList }); - getVariantWithSaleStatus({ - channelSlug: defaultChannel.slug, - variantId: variantsList[0].id, - onSaleStatus: true, - }); - createCheckout({ - channelSlug: defaultChannel.slug, - email: "example@example.com", - address, - variantsList: variantsList.concat(variantNotOnSale), - }).then(({ checkout }) => { - const variantRespOnSale = checkout.lines[0].variant.pricing; - const variantRespNotOnSale = checkout.lines[1].variant.pricing; - - expect(variantRespOnSale.onSale).to.be.true; - expect(variantRespOnSale.price.gross.amount).to.eq( - productPriceOnSale, - ); - expect(variantRespNotOnSale.onSale).to.be.false; - expect(variantRespNotOnSale.price.gross.amount).to.eq( - productData.price, - ); - }); - }); - }, - ); - - it( - "should be able to create percentage discount. TC: SALEOR_1807", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - const expectedPrice = (productPrice * discountValue) / 100; - - createSaleWithNewVariant({ - name: saleName, - channel: defaultChannel, - warehouseId: warehouse.id, - productTypeId: productData.productTypeId, - attributeId: productData.attributeId, - categoryId: productData.categoryId, - price: productPrice, - discountOption: discountOptions.PERCENTAGE, - discountValue, - taxClassId: taxClass.id, - }) - .its("pricing.price.gross.amount") - .should("eq", expectedPrice); - }, - ); - - it( - "should be able to create fixed price discount. TC: SALEOR_1808", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const saleName = `${startsWith}${faker.datatype.number()}`; - const expectedPrice = productPrice - discountValue; - - createSaleWithNewVariant({ - name: saleName, - channel: defaultChannel, - warehouseId: warehouse.id, - productTypeId: productData.productTypeId, - attributeId: productData.attributeId, - categoryId: productData.categoryId, - price: productPrice, - discountOption: discountOptions.FIXED, - discountValue, - }) - .its("pricing.price.gross.amount") - .should("eq", expectedPrice); - }, - ); -}); diff --git a/cypress/e2e/discounts/sales/updateSales.js b/cypress/e2e/discounts/sales/updateSales.js deleted file mode 100644 index 108a9126a34..00000000000 --- a/cypress/e2e/discounts/sales/updateSales.js +++ /dev/null @@ -1,213 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { SALES_SELECTORS } from "../../../elements/discounts/sales"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; -import { saleDetailsUrl } from "../../../fixtures/urlList"; -import { updateSale } from "../../../support/api/requests/Discounts/Sales"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createSaleInChannel, - createSaleInChannelWithProduct, - deleteSalesStartsWith, - getVariantWithSaleStatus, -} from "../../../support/api/utils/discounts/salesUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, - deleteProductsStartsWith, -} from "../../../support/api/utils/products/productsUtils"; -import { - createShipping, - deleteShippingStartsWith, -} from "../../../support/api/utils/shippingUtils"; -import { - getDefaultTaxClass, - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/taxesUtils"; - -describe("As an admin I want to update sales", () => { - const startsWith = "CySales"; - const discountValue = 10; - const productPrice = 30; - const productPriceOnSale = productPrice - discountValue; - - let defaultChannel; - let sale; - let warehouse; - let address; - let productData; - let variants; - let taxClass; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - deleteSalesStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - getDefaultTaxClass(); - }) - .then(taxResp => { - taxClass = taxResp; - createSaleInChannel({ - name, - type: "FIXED", - value: discountValue, - channelId: defaultChannel.id, - }); - }) - .then(saleResp => (sale = saleResp)); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - - createShipping({ - channelId: defaultChannel.id, - address, - name: startsWith, - taxClassId: taxClass.id, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - }); - createTypeAttributeAndCategoryForProduct({ - name, - attributeValues: ["value1", "value2"], - }).then(({ attribute, category, productType }) => { - productData = { - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - price: productPrice, - taxClassId: taxClass.id, - }; - cy.checkIfDataAreNotNull({ - productData, - defaultChannel, - warehouse, - address, - sale, - variants, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - - it( - "should be able to delete sale. TC: SALEOR_1805", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - const productSku = `${startsWith}${faker.datatype.number()}`; - - productData.name = productName; - productData.sku = productSku; - - createProductInChannel(productData) - .then(({ variantsList }) => { - variants = variantsList; - - createSaleInChannelWithProduct({ - name: productName, - type: "FIXED", - value: discountValue, - channelId: defaultChannel.id, - variants, - }); - }) - .then(saleResp => { - getVariantWithSaleStatus({ - channelSlug: defaultChannel.slug, - variantId: variants[0].id, - onSaleStatus: true, - }) - .its("pricing") - .its("price.gross.amount") - .should("eq", productPriceOnSale); - cy.visit(saleDetailsUrl(saleResp.id)) - .addAliasToGraphRequest("SaleDelete") - .get(BUTTON_SELECTORS.deleteButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@SaleDelete"); - getVariantWithSaleStatus({ - channelSlug: defaultChannel.slug, - variantId: variants[0].id, - onSaleStatus: false, - }) - .its("pricing") - .its("price.gross.amount") - .should("eq", productPrice); - }); - }, - ); - - it( - "should be able to remove variant from sale. TC: SALEOR_1806", - { tags: ["@sales", "@allEnv", "@stable"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - - let product; - productData.name = productName; - productData.sku = productName; - - createProductInChannel(productData).then( - ({ variantsList, product: productResp }) => { - product = productResp; - variants = variantsList; - - updateSale({ - saleId: sale.id, - variants, - }); - getVariantWithSaleStatus({ - channelSlug: defaultChannel.slug, - variantId: variants[0].id, - onSaleStatus: true, - }) - .its("pricing") - .its("price.gross.amount") - .should("eq", productPriceOnSale); - cy.visit(saleDetailsUrl(sale.id)) - .get(SALES_SELECTORS.variantsTab) - .click() - .addAliasToGraphRequest("SaleCataloguesRemove"); - cy.contains(SHARED_ELEMENTS.tableRow, product.name) - .find(BUTTON_SELECTORS.button) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@SaleCataloguesRemove"); - getVariantWithSaleStatus({ - channelSlug: defaultChannel.slug, - variantId: variants[0].id, - onSaleStatus: false, - }) - .its("pricing") - .its("price.gross.amount") - .should("eq", productPrice); - }, - ); - }, - ); -}); diff --git a/cypress/e2e/discounts/vouchers/createVouchers.js b/cypress/e2e/discounts/vouchers/createVouchers.js deleted file mode 100644 index cce7811037a..00000000000 --- a/cypress/e2e/discounts/vouchers/createVouchers.js +++ /dev/null @@ -1,188 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../../fixtures/urlList"; -import { createChannel } from "../../../support/api/requests/Channels"; -import { completeCheckout } from "../../../support/api/requests/Checkout"; -import { - addPayment, - createCheckoutWithVoucher, -} from "../../../support/api/utils/ordersUtils"; -import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils"; -import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas"; -import { - createVoucher, - discountOptions, - loginAndCreateCheckoutForVoucherWithDiscount, -} from "../../../support/pages/discounts/vouchersPage"; - -describe("As an admin I want to create voucher", () => { - const startsWith = "CyVou-"; - const productPrice = 100; - const shippingPrice = 100; - const voucherValue = 50; - const name = `${startsWith}${faker.datatype.number()}`; - - let createdChannel; - let dataForCheckout; - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ - variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - address: addressResp, - }) => { - defaultChannel = channel; - - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variantsResp, - address: addressResp, - shippingMethodName: shippingMethodResp.name, - auth: "token", - }; - - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - }); - cy.checkIfDataAreNotNull({ - createdChannel, - dataForCheckout, - defaultChannel, - }); - }, - ); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - it( - "should be able to create fixed price voucher. TC: SALEOR_1901", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const expectedAmount = productPrice + shippingPrice - voucherValue; - let checkout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.FIXED, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - }).then(({ addPromoCodeResp, checkout: checkoutResp }) => { - expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq( - expectedAmount, - ); - dataForCheckout.voucherCode = voucherCode; - checkout = checkoutResp; - - addPayment(checkout.id); - completeCheckout(checkout.id) - .its("order.total.gross.amount") - .should("eq", expectedAmount); - }); - }, - ); - - it( - "should be able to create percentage voucher. TC: SALEOR_1902", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const expectedAmount = - (productPrice * voucherValue) / 100 + shippingPrice; - let checkout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - }).then(({ addPromoCodeResp, checkout: checkoutResp }) => { - expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq( - expectedAmount, - ); - dataForCheckout.voucherCode = voucherCode; - checkout = checkoutResp; - - addPayment(checkout.id); - completeCheckout(checkout.id) - .its("order.total.gross.amount") - .should("eq", expectedAmount); - }); - }, - ); - - it( - "should be able to create free shipping voucher. TC: SALEOR_1903", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const expectedAmount = productPrice; - let checkout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.SHIPPING, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - }).then(({ addPromoCodeResp, checkout: checkoutResp }) => { - expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq( - expectedAmount, - ); - dataForCheckout.voucherCode = voucherCode; - checkout = checkoutResp; - - addPayment(checkout.id); - completeCheckout(checkout.id) - .its("order.total.gross.amount") - .should("eq", productPrice); - }); - }, - ); - - it( - "should be able to create voucher not available for selected channel. TC: SALEOR_1904", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest().visit(urlList.vouchers); - ensureCanvasStatic(); - createChannel({ name }).then(channel => { - createdChannel = channel; - - cy.reload(); - createVoucher({ - voucherCode, - voucherValue, - discountOption: discountOptions.PERCENTAGE, - channelName: createdChannel.name, - }); - }); - - dataForCheckout.voucherCode = voucherCode; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { message: "Promo code is invalid" }); - }, - ); -}); diff --git a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js b/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js deleted file mode 100644 index cf4576d7d77..00000000000 --- a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js +++ /dev/null @@ -1,225 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { completeCheckout } from "../../../support/api/requests/Checkout"; -import { - addPayment, - createCheckoutWithVoucher, -} from "../../../support/api/utils/ordersUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { - discountOptions, - loginAndCreateCheckoutForVoucherWithDiscount, -} from "../../../support/pages/discounts/vouchersPage"; - -describe("As an admin I want to create voucher", () => { - const startsWith = "CyVouLimit-"; - const productPrice = 100; - const shippingPrice = 100; - const voucherValue = 50; - - let defaultChannel; - let dataForCheckout; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ - variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - address: addressResp, - }) => { - defaultChannel = channel; - - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variantsResp, - address: addressResp, - shippingMethodName: shippingMethodResp.name, - auth: "token", - }; - cy.checkIfDataAreNotNull({ dataForCheckout, defaultChannel }); - cy.clearSessionData(); - }, - ); - }); - - it( - "should be able to create voucher with limited number of times discount can be used in total. TC: SALEOR_1907", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const usageLimit = 1; - dataForCheckout.auth = "auth"; - let firstCheckout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - usageLimit, - }).then(({ checkout, addPromoCodeResp }) => { - expect(addPromoCodeResp.errors).to.be.empty; - firstCheckout = checkout; - dataForCheckout.voucherCode = voucherCode; - - addPayment(firstCheckout.id); - completeCheckout(firstCheckout.id); - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { message: "Promo code is invalid" }); - }); - }, - ); - - it( - "should be able to create voucher with limit to one use per customer. TC: SALEOR_1908", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - dataForCheckout.auth = "auth"; - let firstCheckout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - applyOnePerCustomer: true, - }).then(({ checkout, addPromoCodeResp }) => { - expect(addPromoCodeResp.errors).to.be.empty; - firstCheckout = checkout; - dataForCheckout.voucherCode = voucherCode; - - addPayment(firstCheckout.id); - completeCheckout(firstCheckout.id); - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { - message: "Voucher is not applicable to this checkout.", - }); - - // Create new checkout as other not logged in customer - voucher should be available for other customer - - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - dataForCheckout.email = "newUser@example.com"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - }); - }, - ); - - it( - "should be able to create voucher with limit to staff only. TC: SALEOR_1909", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - dataForCheckout.auth = "auth"; - let firstCheckout; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - onlyStaff: true, - }).then(({ checkout, addPromoCodeResp }) => { - expect(addPromoCodeResp.errors).to.be.empty; - firstCheckout = checkout; - dataForCheckout.voucherCode = voucherCode; - - addPayment(firstCheckout.id); - completeCheckout(firstCheckout.id); - - // Create new checkout as other not logged in customer - voucher should be not available for other customer - - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - dataForCheckout.email = "newUser@example.com"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { - message: "Voucher is not applicable to this checkout.", - }); - }); - }, - ); - - it( - "should be able to create voucher with minimum value of order. TC: SALEOR_1910", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const minOrderValue = productPrice * 1.5; - dataForCheckout.productQuantity = 1; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - minOrderValue, - }) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { - message: "Voucher is not applicable to this checkout.", - }); - dataForCheckout.voucherCode = voucherCode; - dataForCheckout.productQuantity = 2; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - }, - ); - - it( - "should create voucher with min product quantity. TC: SALEOR_1911", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - dataForCheckout.productQuantity = 1; - - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - minAmountOfItems: 2, - }) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { - message: "Voucher is not applicable to this checkout.", - }); - dataForCheckout.voucherCode = voucherCode; - dataForCheckout.productQuantity = 2; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - }, - ); -}); diff --git a/cypress/e2e/discounts/vouchers/updateVouchers.js b/cypress/e2e/discounts/vouchers/updateVouchers.js deleted file mode 100644 index 2bf959cf06e..00000000000 --- a/cypress/e2e/discounts/vouchers/updateVouchers.js +++ /dev/null @@ -1,278 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { voucherDetailsUrl } from "../../../fixtures/urlList"; -import { createVoucherInChannel } from "../../../support/api/utils/discounts/vouchersUtils"; -import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils"; -import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils"; -import { formatDate, formatTime } from "../../../support/formatData/formatDate"; -import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage"; - -describe("As an admin I want to update vouchers", () => { - const startsWith = "UpdateVou-"; - const productPrice = 100; - const shippingPrice = 100; - const voucherValue = 50; - - let defaultChannel; - let product; - let dataForCheckout; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ - variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - address: addressResp, - product: productResp, - }) => { - defaultChannel = channel; - product = productResp; - - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variantsResp, - address: addressResp, - shippingMethodName: shippingMethodResp.name, - auth: "token", - }; - cy.checkIfDataAreNotNull({ - dataForCheckout, - defaultChannel, - product, - }); - }, - ); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - it( - "should delete voucher. TC: SALEOR_1905", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest(); - createVoucherInChannel({ - name, - productId: product.id, - channelId: defaultChannel.id, - value: voucherValue, - }).then(voucherResp => { - expect(voucherResp.voucher.id).to.be.ok; - - cy.visit(voucherDetailsUrl(voucherResp.voucher.id)) - .addAliasToGraphRequest("VoucherDelete") - .get(BUTTON_SELECTORS.deleteButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@VoucherDelete"); - - dataForCheckout.voucherCode = voucherResp.voucher.code; - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { message: "Promo code is invalid" }); - }); - }, - ); - - it( - "should update voucher. TC: SALEOR_1906", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const voucherUpdatedValue = 20; - const expectedOrderAmount = - productPrice + - shippingPrice - - (productPrice * voucherUpdatedValue) / 100; - - cy.clearSessionData().loginUserViaRequest(); - createVoucherInChannel({ - name, - productId: product.id, - channelId: defaultChannel.id, - value: voucherValue, - }).then(voucherResp => { - expect(voucherResp.voucher.id).to.be.ok; - - cy.visit(voucherDetailsUrl(voucherResp.voucher.id)) - .addAliasToGraphRequest("VoucherUpdate") - .get(VOUCHERS_SELECTORS.percentageDiscountRadioButton) - .click() - .get(VOUCHERS_SELECTORS.discountValueInputs) - .clearAndType(voucherUpdatedValue) - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@VoucherUpdate"); - - dataForCheckout.voucherCode = voucherResp.voucher.code; - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.checkout.totalPrice.gross.amount") - .should("eq", expectedOrderAmount); - }); - }, - ); - - it( - "should set date on voucher. TC: SALEOR_1912", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const todayDate = formatDate(new Date()); - const tomorrowDate = formatDate( - new Date().setDate(new Date().getDate() + 1), - ); - - cy.clearSessionData().loginUserViaRequest(); - createVoucherInChannel({ - name, - productId: product.id, - channelId: defaultChannel.id, - value: voucherValue, - }).then(voucherResp => { - expect(voucherResp.voucher.id).to.be.ok; - - setVoucherDate({ - voucherId: voucherResp.voucher.id, - startDate: tomorrowDate, - }); - dataForCheckout.voucherCode = voucherResp.voucher.code; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { message: "Promo code is invalid" }); - setVoucherDate({ - voucherId: voucherResp.voucher.id, - startDate: todayDate, - }); - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - }); - }, - ); - - it( - "should set end date on voucher. TC: SALEOR_1913", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const todayDate = formatDate(new Date()); - const tomorrowDate = formatDate( - new Date().setDate(new Date().getDate() + 1), - ); - - cy.clearSessionData().loginUserViaRequest(); - createVoucherInChannel({ - name, - productId: product.id, - channelId: defaultChannel.id, - value: voucherValue, - }).then(voucherResp => { - expect(voucherResp.voucher.id).to.be.ok; - - setVoucherDate({ - voucherId: voucherResp.voucher.id, - endDate: todayDate, - endTime: formatTime(new Date()), - hasEndDate: true, - }); - dataForCheckout.voucherCode = voucherResp.voucher.code; - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { message: "Promo code is invalid" }); - setVoucherDate({ - voucherId: voucherResp.voucher.id, - endDate: tomorrowDate, - endTime: formatTime(new Date()), - }); - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - }); - }, - ); - - it( - "should set country on voucher. TC: SALEOR_1914", - { tags: ["@vouchers", "@allEnv", "@stable"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest(); - createVoucherInChannel({ - name, - productId: product.id, - channelId: defaultChannel.id, - value: voucherValue, - type: "SHIPPING", - country: "US", - }).then(voucherResp => { - expect(voucherResp.voucher.id).to.be.ok; - dataForCheckout.voucherCode = voucherResp.voucher.code; - window.sessionStorage.setItem("token", ""); - dataForCheckout.auth = "token"; - - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors") - .should("be.be.empty"); - cy.visit(voucherDetailsUrl(voucherResp.voucher.id)) - .get(VOUCHERS_SELECTORS.shippingDiscountRadioButton) - .click() - .get(VOUCHERS_SELECTORS.countriesDropdownIcon) - .click() - .get(BUTTON_SELECTORS.deleteIcon) - .click() - .get(BUTTON_SELECTORS.deleteIcon) - .should("not.exist") - .get(VOUCHERS_SELECTORS.assignCountryButton) - .click() - .assignElements("Poland") - .addAliasToGraphRequest("VoucherUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@VoucherUpdate"); - createCheckoutWithVoucher(dataForCheckout) - .its("addPromoCodeResp.errors.0") - .should("include", { field: "promoCode" }) - .and("include", { - message: "Voucher is not applicable to this checkout.", - }); - }); - }, - ); -}); diff --git a/cypress/e2e/homePage/homePage.js b/cypress/e2e/homePage/homePage.js deleted file mode 100644 index dfb00546755..00000000000 --- a/cypress/e2e/homePage/homePage.js +++ /dev/null @@ -1,42 +0,0 @@ -/// -/// - -import { urlList } from "../../fixtures/urlList"; -import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../fixtures/users"; -import { expectWelcomeMessageIncludes } from "../../support/pages/homePage"; - -describe("Displaying welcome message on home page", () => { - it( - "should display user name on home page", - { tags: ["@homePage", "@allEnv", "@stable", "@oldRelease"] }, - () => { - cy.loginUserViaRequest().visit(urlList.homePage); - expectWelcomeMessageIncludes( - `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`, - ); - }, - ); - - it( - "should display user email on home page", - { tags: ["@homePage", "@allEnv", "@stable", "@oldRelease"] }, - () => { - cy.loginUserViaRequest("auth", USER_WITHOUT_NAME).visit(urlList.homePage); - expectWelcomeMessageIncludes(`${USER_WITHOUT_NAME.email}`); - }, - ); - - it( - "should refresh page without errors", - { tags: ["@homePage", "@allEnv", "@stable", "@oldRelease"] }, - () => { - cy.loginUserViaRequest() - .visit(urlList.homePage) - .waitForProgressBarToNotExist() - .reload(true); - expectWelcomeMessageIncludes( - `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`, - ); - }, - ); -}); diff --git a/cypress/e2e/login.js b/cypress/e2e/login.js deleted file mode 100644 index 21cfa387930..00000000000 --- a/cypress/e2e/login.js +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// - -import { LOGIN_SELECTORS } from "../elements/account/login-selectors"; -import { urlList } from "../fixtures/urlList"; - -describe("User authorization", () => { - it( - "should successfully log in an user", - { tags: ["@login", "@allEnv", "@stable", "@oldRelease"] }, - () => { - cy.visit(urlList.homePage); - cy.loginUser(); - cy.get(LOGIN_SELECTORS.welcomePage).should("be.visible"); - }, - ); - - it( - "should fail for wrong password", - { tags: ["@login", "@allEnv", "@stable"] }, - () => { - cy.visit(urlList.homePage) - .get(LOGIN_SELECTORS.emailAddressInput) - .type("admin@example.com") - .get(LOGIN_SELECTORS.emailPasswordInput) - .type("wrong-password") - .get(LOGIN_SELECTORS.signInButton) - .click() - .get(LOGIN_SELECTORS.warningCredentialMessage) - .should("be.visible"); - }, - ); - - it( - "should successfully log out an user", - { tags: ["@login", "@allEnv", "@stable"] }, - () => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.homePage) - .get(LOGIN_SELECTORS.userMenu) - .click() - .get(LOGIN_SELECTORS.logOutButton) - .click() - .get(LOGIN_SELECTORS.emailAddressInput) - .should("be.visible"); - }, - ); -}); diff --git a/cypress/e2e/metadata.js b/cypress/e2e/metadata.js deleted file mode 100644 index 1c91895926e..00000000000 --- a/cypress/e2e/metadata.js +++ /dev/null @@ -1,116 +0,0 @@ -/// -/// -import faker from "faker"; - -import { - updateMetadata, - updatePrivateMetadata, -} from "../support/api/requests/Metadata"; -import { - createDraftOrder, - getOrder, -} from "../support/api/requests/Order"; -import { - getProductMetadata, -} from "../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../support/api/utils/products/productsUtils"; - -describe("Test for metadata", () => { - const startsWith = "Metadata"; - const name = `${startsWith}${faker.datatype.number()}`; - const metadata = { key: "metadataKey", value: "metadataValue" }; - let channel; - let product; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channelResp => { - channel = channelResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, category, productType }) => { - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: channel.id, - name, - productTypeId: productType.id, - }); - }) - .then(({ product: productResp }) => { - product = productResp; - cy.checkIfDataAreNotNull({ channel, product }); - }); - }); - - it( - "should create metadata for product TC: SALEOR_3301", - { tags: ["@metadata", "@allEnv", "@stable"] }, - () => { - cy.loginUserViaRequest(); - updateMetadata(product.id, metadata.key, metadata.value); - updatePrivateMetadata(product.id, metadata.key, metadata.value) - .then(() => { - getProductMetadata({ - productId: product.id, - channelSlug: channel.slug, - auth: "auth", - withPrivateMetadata: true, - }).its("data"); - }) - .then(({ product: productResp }) => { - expect(productResp.metadata[0].key).to.eq(metadata.key); - expect(productResp.metadata[0].value).to.eq(metadata.value); - expect(productResp.privateMetadata[0].key).to.eq(metadata.key); - expect(productResp.privateMetadata[0].value).to.eq(metadata.value); - getProductMetadata({ - productId: product.id, - channelSlug: channel.slug, - auth: "token", - withPrivateMetadata: true, - }); - }) - .then(({ errors }) => { - expect(errors[0].extensions.exception.code).to.eq("PermissionDenied"); - getProductMetadata({ - productId: product.id, - channelSlug: channel.slug, - auth: "token", - withPrivateMetadata: false, - }).its("data"); - }) - .then(({ product: productResp }) => { - expect(productResp.metadata[0].key).to.eq(metadata.key); - expect(productResp.metadata[0].value).to.eq(metadata.value); - }); - }, - ); - it( - "should create metadata for order TC: SALEOR_3302", - { tags: ["@metadata", "@allEnv", "@stable"] }, - () => { - let order; - cy.loginUserViaRequest(); - createDraftOrder({ channelId: channel.id }) - .then(orderResp => { - order = orderResp; - updateMetadata(order.id, metadata.key, metadata.value); - updatePrivateMetadata(order.id, metadata.key, metadata.value); - }) - .then(() => { - getOrder(order.id); - }) - .then(orderResp => { - expect(orderResp.metadata[0].key).to.eq(metadata.key); - expect(orderResp.metadata[0].value).to.eq(metadata.value); - expect(orderResp.privateMetadata[0].key).to.eq(metadata.key); - expect(orderResp.privateMetadata[0].value).to.eq(metadata.value); - }); - }, - ); -}); diff --git a/cypress/e2e/orders/channelsInDraftOrders.js b/cypress/e2e/orders/channelsInDraftOrders.js deleted file mode 100644 index 202d500fb38..00000000000 --- a/cypress/e2e/orders/channelsInDraftOrders.js +++ /dev/null @@ -1,116 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - CHANNEL_FORM_SELECTORS, -} from "../../elements/channels/channel-form-selectors"; -import { HEADER_SELECTORS } from "../../elements/header/header-selectors"; -import { - DRAFT_ORDER_SELECTORS, -} from "../../elements/orders/draft-order-selectors"; -import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; -import { urlList } from "../../fixtures/urlList"; -import { createChannel } from "../../support/api/requests/Channels"; -import * as channelsUtils from "../../support/api/utils/channelsUtils"; -import { - selectChannelInHeader, - selectChannelInPicker, -} from "../../support/pages/channelsPage"; - -xdescribe("Channels in draft orders", () => { - const startsWith = "CyChannelInDraftOrders-"; - const randomName = startsWith + faker.datatype.number(); - - let defaultChannel; - let otherChannel; - - before(() => { - cy.loginUserViaRequest(); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - createChannel({ name: randomName }); - }) - .then(channelResp => { - otherChannel = channelResp; - cy.checkIfDataAreNotNull({ defaultChannel, otherChannel }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "Draft order channel should be taken from global channel picker. TC: SALEOR_2101", - { tags: ["@orders", "@allEnv"] }, - () => { - let channelName; - cy.visit(urlList.homePage); - cy.getTextFromElement(HEADER_SELECTORS.channelSelect).then( - channelInHeader => { - channelName = channelInHeader; - }, - ); - cy.visit(urlList.orders).get(ORDERS_SELECTORS.createOrderButton).click(); - cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then( - selectedChannelName => { - expect(channelName).to.contains(selectedChannelName); - }, - ); - cy.get(CHANNEL_FORM_SELECTORS.confirmButton).click(); - cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then( - channelNameInDraftOrder => { - expect(channelName).to.contains(channelNameInDraftOrder); - }, - ); - }, - ); - - it( - "Draft order channel should be taken from global channel picker when changed. TC: SALEOR_2102", - { tags: ["@orders", "@allEnv"] }, - () => { - cy.visit(urlList.homePage); - selectChannelInHeader(otherChannel.name); - cy.visit(urlList.orders); - cy.get(ORDERS_SELECTORS.createOrderButton).click(); - cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then( - channelInSelect => { - expect(channelInSelect).to.be.eq(otherChannel.name); - }, - ); - cy.get(CHANNEL_FORM_SELECTORS.confirmButton).click(); - cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then( - channelInDraftOrder => { - expect(channelInDraftOrder).to.be.eq(otherChannel.name); - }, - ); - }, - ); - - it( - "should create draft order with chosen channel", - { tags: ["@orders", "@allEnv"] }, - () => { - cy.visit(urlList.homePage); - selectChannelInHeader(defaultChannel.name); - cy.visit(urlList.orders); - cy.get(ORDERS_SELECTORS.createOrderButton).click(); - cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then( - channelInSelect => { - expect(channelInSelect).to.be.eq(defaultChannel.name); - }, - ); - selectChannelInPicker(otherChannel.name); - cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then( - channelInDraftOrder => { - expect(channelInDraftOrder).to.be.eq(otherChannel.name); - }, - ); - }, - ); -}); diff --git a/cypress/e2e/orders/draftOrders.js b/cypress/e2e/orders/draftOrders.js deleted file mode 100644 index a75303e7c33..00000000000 --- a/cypress/e2e/orders/draftOrders.js +++ /dev/null @@ -1,188 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { SHARED_ELEMENTS } from "../../elements/"; -import { urlList } from "../../fixtures/urlList"; -import { - createCustomer, - getDraftOrdersList, - getOrdersList, - updateOrdersSettings, -} from "../../support/api/requests/"; -import { - createShipping, - createUnconfirmedOrder, - getDefaultChannel, -} from "../../support/api/utils/"; -import * as productsUtils from "../../support/api/utils/products/productsUtils"; - -describe("Draft orders", () => { - const startsWith = "CyDraftOrders-"; - const randomName = startsWith + faker.datatype.number(); - let customer; - let defaultChannel; - let warehouse; - let address; - let variantsList; - let shippingMethod; - - before(() => { - cy.loginUserViaRequest(); - updateOrdersSettings(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - }) - .then(() => { - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createCustomer( - `${randomName}@example.com`, - randomName, - addresses.plAddress, - true, - ).then(customerResp => { - customer = customerResp.user; - }); - createShipping({ - channelId: defaultChannel.id, - name: randomName, - address: addresses.plAddress, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: randomName, - }); - }, - ) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp, - }) => { - productsUtils.createProductInChannel({ - name: randomName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id, - }); - }, - ) - .then(({ variantsList: variantsResp, product }) => { - variantsList = variantsResp; - cy.checkIfDataAreNotNull({ defaultChannel, warehouse, address }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should move draft order to orders. TC: SALEOR_2103", - { tags: ["@orders", "@allEnv"] }, - () => { - let draftOrderNumber; - let order; - cy.addAliasToGraphRequest("OrderDraftFinalize"); - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }).then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.clickFinalizeButton() - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors("@OrderDraftFinalize") - .then(finalizedDraftOrderResponse => { - draftOrderNumber = - finalizedDraftOrderResponse.response.body.data.draftOrderComplete - .order.number; - cy.get(SHARED_ELEMENTS.pageHeader).should( - "contain.text", - draftOrderNumber, - ); - getDraftOrdersList().then(draftOrdersListResponse => { - draftOrdersListResponse.edges.forEach(order => { - expect(order.node.number).not.eq(draftOrderNumber); - }); - }); - getOrdersList().then(ordersListResponse => { - expect(JSON.stringify(ordersListResponse.edges)).to.contains( - `"number":"${draftOrderNumber}"`, - ); - }); - }); - }); - }, - ); - - it( - "should be able to turn of all but one static columns on draft orders detail. TC: SALEOR_2135", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - let order; - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }).then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.openColumnPicker(); - cy.get(SHARED_ELEMENTS.staticColumnContainer) - .should("contain.text", "Product") - .should("contain.text", "SKU") - .should("contain.text", "Variant") - .should("contain.text", "Quantity") - .should("contain.text", "Price") - .should("contain.text", "Total") - .should("contain.text", "Is gift") - .should("contain.text", "Metadata") - .should("contain.text", "Status"); - // switching off all but one static columns - cy.get(SHARED_ELEMENTS.gridStaticSkuButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticVariantNameButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticQuantityButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticPriceButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticTotalButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticStatusButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticIsGiftButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticMetadataButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticProductButton).should( - "have.attr", - "data-state", - "on", - ); - cy.get(SHARED_ELEMENTS.dataGridTable) - .find("th") - // on draft first th is empty so length need to be 2 - .should("have.length", 2) - .last() - .should("have.text", "Product"); - // next line hides picker - cy.get(SHARED_ELEMENTS.pageHeader).click({ force: true }); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer).should("not.exist"); - }); - }, - ); -}); diff --git a/cypress/e2e/orders/manageStockReservation.js b/cypress/e2e/orders/manageStockReservation.js deleted file mode 100644 index 9cb3533624c..00000000000 --- a/cypress/e2e/orders/manageStockReservation.js +++ /dev/null @@ -1,174 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { createCheckout } from "../../support/api/requests/Checkout"; -import { - updateStockReservation, -} from "../../support/api/requests/ShopSettings"; -import { getDefaultChannel } from "../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../support/api/utils/shippingUtils"; -import { - enterSiteSettingAndSetStockReservation, - userType, -} from "../../support/pages/siteSettings"; - -describe("As an admin I want to manage stock reservation", () => { - const startsWith = "manageStocks"; - const name = `${startsWith}${faker.datatype.number()}`; - const productQuantity = 10; - const customerType = { - authenticated: "auth", - anonymous: "token", - }; - - let defaultChannel; - let address; - let warehouse; - let attribute; - let category; - let productType; - let dataForCheckout; - - before(() => { - cy.loginUserViaRequest(); - - cy.fixture("addresses").then(addresses => { - address = addresses.usAddress; - - getDefaultChannel().then(channel => { - defaultChannel = channel; - - createShipping({ - channelId: defaultChannel.id, - name, - address, - }).then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - - createTypeAttributeAndCategoryForProduct({ name }).then( - ({ - attribute: attributeResp, - category: categoryResp, - productType: productTypeResp, - }) => { - attribute = attributeResp; - category = categoryResp; - productType = productTypeResp; - }, - ); - cy.checkIfDataAreNotNull({ - defaultChannel, - address, - warehouse, - attribute, - category, - productType, - dataForCheckout, - }); - }); - }); - }); - }); - - after(() => { - updateStockReservation({}).its("errors").should("be.empty"); - }); - - beforeEach(() => { - const productName = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: defaultChannel.id, - name: productName, - productTypeId: productType.id, - warehouseId: warehouse.id, - quantityInWarehouse: productQuantity, - }).then(({ variantsList }) => { - dataForCheckout = { - email: "example@example.pl", - address, - channelSlug: defaultChannel.slug, - variantsList, - productQuantity, - }; - }); - }); - - it( - "should be able to set stock reservation for authenticated customer in checkout. TC: SALEOR_0415", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - dataForCheckout.auth = customerType.authenticated; - - updateStockReservation({}); - enterSiteSettingAndSetStockReservation(userType.authenticated, 10); - createCheckout(dataForCheckout).its("checkout").should("be.ok"); - createCheckout(dataForCheckout) - .its("errors.0") - .should("include", { field: "quantity" }) - .and("include", { - message: "Could not add items value. Only 0 remaining in stock.", - }); - }, - ); - - it( - "should be able to set stock reservation for anonymous customer in checkout. TC: SALEOR_0416", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - dataForCheckout.auth = customerType.anonymous; - - updateStockReservation({}); - enterSiteSettingAndSetStockReservation(userType.anonymous, 10); - createCheckout(dataForCheckout).its("checkout").should("be.ok"); - createCheckout(dataForCheckout) - .its("errors.0") - .should("include", { field: "quantity" }) - .and("include", { - message: "Could not add items value. Only 0 remaining in stock.", - }); - }, - ); - - it( - "should be able to leave empty stock reservation for authenticated customer in checkout. TC: SALEOR_0417", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - dataForCheckout.auth = customerType.authenticated; - - updateStockReservation({ authenticatedUserStock: 10 }); - enterSiteSettingAndSetStockReservation(userType.authenticated); - createCheckout(dataForCheckout).its("checkout").should("be.ok"); - createCheckout(dataForCheckout) - .should("be.ok") - .its("errors") - .should("be.empty"); - }, - ); - - it( - "should be able to leave empty stock reservation for anonymous customer in checkout. TC: SALEOR_0418", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - dataForCheckout.auth = customerType.anonymous; - - updateStockReservation({ anonymousUserStock: 10 }); - enterSiteSettingAndSetStockReservation(userType.anonymous); - createCheckout(dataForCheckout).its("checkout").should("be.ok"); - createCheckout(dataForCheckout) - .should("be.ok") - .its("errors") - .should("be.empty"); - }, - ); -}); diff --git a/cypress/e2e/orders/orders.js b/cypress/e2e/orders/orders.js deleted file mode 100644 index 6e2d77e9c58..00000000000 --- a/cypress/e2e/orders/orders.js +++ /dev/null @@ -1,610 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - BUTTON_SELECTORS, - ORDER_GRANT_REFUND, - ORDERS_SELECTORS, - SHARED_ELEMENTS, -} from "../../elements/"; -import { MESSAGES, ONE_PERMISSION_USERS, urlList } from "../../fixtures"; -import { - createCustomer, - getOrder, - updateMetadata, - updateOrdersSettings, - updatePrivateMetadata, -} from "../../support/api/requests/"; -import { - createFulfilledOrder, - createOrder, - createReadyToFulfillOrder, - createShipping, - createUnconfirmedOrder, - getDefaultChannel, - getDefaultTaxClass, - productsUtils, - updateTaxConfigurationForChannel, -} from "../../support/api/utils/"; -import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas"; -import { - addNewProductToOrder, - addPrivateMetadataFieldFulfillmentOrder, - addPublicMetadataFieldFulfillmentOrder, - applyFixedLineDiscountForProduct, - changeQuantityOfProducts, - deletePrivateFulfillmentMetadata, - deleteProductFromGridTableOnIndex, - deletePublicFulfillmentMetadata, - expandPrivateFulfillmentMetadata, - expandPublicFulfillmentMetadata, - openVariantDetailsOptions, - updatePrivateMetadataFieldFulfillmentOrder, - updatePublicMetadataFieldFulfillmentOrder, -} from "../../support/pages/"; - -describe("Orders", () => { - const startsWith = "Orders-Cy-"; - const randomName = startsWith + faker.datatype.number(); - - let customer; - let defaultChannel; - let warehouse; - let shippingMethod; - let variantsList; - let address; - let taxClass; - let productDetails; - - const shippingPrice = 2; - const variantPrice = 1; - const metadataName = randomName + "- metadata name"; - const metadataValue = randomName + "- metadata value"; - const privateMetadataName = randomName + "- private metadata name"; - const privateMetadataValue = randomName + "- private metadata value"; - const updatedMetadataName = metadataName + "- updated metadata name"; - const updatedMetadataValue = metadataValue + "- updated metadata value"; - const updatedPrivateMetadataName = - privateMetadataName + "- updated private metadata name"; - const updatedPrivateMetadataValue = - privateMetadataValue + "- updated private metadata value"; - - before(() => { - cy.loginUserViaRequest(); - updateOrdersSettings(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - updateTaxConfigurationForChannel({ channelSlug: defaultChannel.slug }); - getDefaultTaxClass(); - }) - .then(resp => { - taxClass = resp; - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createCustomer(`${randomName}@example.com`, randomName, address, true); - }) - .then(customerResp => { - customer = customerResp.user; - createShipping({ - channelId: defaultChannel.id, - name: randomName, - price: shippingPrice, - address, - taxClassId: taxClass.id, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - shippingMethod = shippingMethodResp; - warehouse = warehouseResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: randomName, - }); - }, - ) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp, - }) => { - productsUtils.createProductInChannel({ - name: randomName, - channelId: defaultChannel.id, - price: variantPrice, - warehouseId: warehouse.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id, - taxClassId: taxClass.id, - }); - }, - ) - .then(({ variantsList: variantsResp, product }) => { - productDetails = product; - variantsList = variantsResp; - cy.checkIfDataAreNotNull({ - customer, - defaultChannel, - warehouse, - shippingMethod, - variantsList, - address, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.order); - }); - - it( - "should not be possible to change channel in order. TC: SALEOR_2105", - { tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] }, - () => { - createOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(order => { - cy.visit(urlList.orders + `${order.id}`); - cy.get(ORDERS_SELECTORS.salesChannel) - .find("[button]") - .should("not.exist"); - }); - }, - ); - - it( - "should cancel fulfillment. TC: SALEOR_2106", - { tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] }, - () => { - let order; - createFulfilledOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }) - .then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(ORDERS_SELECTORS.cancelFulfillment) - .click() - .get(ORDERS_SELECTORS.cancelFulfillmentSelectField) - .click() - .get(BUTTON_SELECTORS.selectOption) - .first() - .click() - .addAliasToGraphRequest("OrderFulfillmentCancel") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel"); - getOrder(order.id); - }) - .then(orderResp => { - expect(orderResp.status).to.be.eq("UNFULFILLED"); - }); - }, - ); - - it( - "should make a refund. TC: 2107", - { tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] }, - () => { - let order; - createReadyToFulfillOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }) - .then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.get(ORDERS_SELECTORS.refundButton) - .click() - .get(ORDER_GRANT_REFUND.productsQuantityInput) - .type("1") - .addAliasToGraphRequest("OrderFulfillmentRefundProducts"); - cy.get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors( - "@OrderFulfillmentRefundProducts", - ); - getOrder(order.id); - }) - .then(orderResp => { - expect(orderResp.paymentStatus).to.be.eq("PARTIALLY_REFUNDED"); - }); - }, - ); - - it( - "should add line item discount (for single product in order) . TC: SALEOR_2125", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - const totalPrice = variantPrice + shippingPrice; - const inlineDiscount = 0.5; - const discountReason = "product damaged"; - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(unconfirmedOrderResponse => { - cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`); - applyFixedLineDiscountForProduct(inlineDiscount, discountReason); - cy.get(ORDERS_SELECTORS.priceCellFirstRowOrderDetails).should( - "have.text", - inlineDiscount, - ); - cy.get(ORDERS_SELECTORS.orderSummarySubtotalPriceRow).should( - "contain.text", - variantPrice - inlineDiscount, - ); - cy.get(ORDERS_SELECTORS.orderSummaryTotalPriceRow).should( - "contain.text", - totalPrice - inlineDiscount, - ); - }); - }, - ); - - it( - "should remove product from unconfirmed order . TC: SALEOR_2126", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(unconfirmedOrderResponse => { - cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`); - deleteProductFromGridTableOnIndex(1); - cy.contains(MESSAGES.noProductFound).should("be.visible"); - cy.get(ORDERS_SELECTORS.productDeleteFromRowButton).should("not.exist"); - }); - }, - ); - it( - "should change quantity of products on order detail view . TC: SALEOR_2127", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(unconfirmedOrderResponse => { - cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - changeQuantityOfProducts(); - - cy.get(ORDERS_SELECTORS.orderSummarySubtotalPriceRow).should( - "contain.text", - variantPrice * 2, - ); - cy.get(ORDERS_SELECTORS.orderSummaryTotalPriceRow).should( - "contain.text", - shippingPrice + variantPrice * 2, - ); - }); - }, - ); - it( - "should add new product on order detail view . TC: SALEOR_2128", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(unconfirmedOrderResponse => { - cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`); - cy.get(ORDERS_SELECTORS.dataGridTable).should("be.visible"); - addNewProductToOrder().then(productName => { - cy.get(ORDERS_SELECTORS.productNameSecondRowOrderDetails).should( - "contain.text", - productName, - ); - }); - }); - }, - ); - - it( - "should create metadata and private metadata for fulfilled order . TC: SALEOR_2129", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - let order; - - cy.addAliasToGraphRequest("UpdateMetadata"); - cy.addAliasToGraphRequest("UpdatePrivateMetadata"); - createFulfilledOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }) - .then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - addPublicMetadataFieldFulfillmentOrder( - 0, - metadataName, - metadataValue, - ); - addPrivateMetadataFieldFulfillmentOrder( - 0, - privateMetadataName, - privateMetadataValue, - ); - }) - .then(() => { - cy.clickConfirmButton() - .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") - .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); - cy.confirmationMessageShouldAppear(); - getOrder(order.id).then(orderResponse => { - // check to see updated fulfillment metadata and private meta data - cy.wrap(orderResponse.fulfillments[0].metadata[0]).should( - "deep.equal", - { - key: metadataName, - value: metadataValue, - }, - ); - cy.wrap(orderResponse.fulfillments[0].privateMetadata[0]).should( - "deep.equal", - { - key: privateMetadataName, - value: privateMetadataValue, - }, - ); - }); - }); - }, - ); - it( - "should update metadata and private metadata for fulfilled order . TC: SALEOR_2130", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("UpdateMetadata"); - cy.addAliasToGraphRequest("UpdatePrivateMetadata"); - createFulfilledOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }).then(orderResp => { - getOrder(orderResp.order.id).then(orderDetails => { - updateMetadata( - orderDetails.fulfillments[0].id, - metadataName, - metadataValue, - ).then(() => { - updatePrivateMetadata( - orderDetails.fulfillments[0].id, - privateMetadataName, - privateMetadataValue, - ) - .then(() => { - cy.visit(urlList.orders + `${orderResp.order.id}`); - updatePublicMetadataFieldFulfillmentOrder( - 0, - updatedMetadataName, - updatedMetadataValue, - ); - updatePrivateMetadataFieldFulfillmentOrder( - 0, - updatedPrivateMetadataName, - updatedPrivateMetadataValue, - ); - }) - .then(() => { - cy.clickConfirmButton() - .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") - .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); - cy.confirmationMessageShouldAppear(); - getOrder(orderResp.order.id).then(orderResponse => { - // check to see updated fulfillment metadata and private meta data - cy.wrap(orderResponse.fulfillments[0].metadata[0]).should( - "deep.equal", - { - key: updatedMetadataName, - value: updatedMetadataValue, - }, - ); - cy.wrap( - orderResponse.fulfillments[0].privateMetadata[0], - ).should("deep.equal", { - key: updatedPrivateMetadataName, - value: updatedPrivateMetadataValue, - }); - }); - }); - }); - }); - }); - }, - ); - it( - "should delete metadata and private metadata for fulfilled order . TC: SALEOR_2131", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("UpdateMetadata"); - cy.addAliasToGraphRequest("UpdatePrivateMetadata"); - createFulfilledOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - warehouse: warehouse.id, - }).then(orderResp => { - getOrder(orderResp.order.id).then(orderDetails => { - updateMetadata( - orderDetails.fulfillments[0].id, - metadataName, - metadataValue, - ).then(() => { - updatePrivateMetadata( - orderDetails.fulfillments[0].id, - privateMetadataName, - privateMetadataValue, - ) - .then(() => { - cy.visit(urlList.orders + `${orderResp.order.id}`); - expandPublicFulfillmentMetadata(0); - deletePublicFulfillmentMetadata(0, 0); - expandPrivateFulfillmentMetadata(0); - deletePrivateFulfillmentMetadata(0, 0); - }) - .then(() => { - cy.clickConfirmButton() - .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") - .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); - cy.confirmationMessageShouldAppear(); - cy.contains(privateMetadataName).should("not.exist"); - cy.contains(metadataName).should("not.exist"); - getOrder(orderResp.order.id).then(orderResponse => { - // check to see updated fulfillment metadata and private meta data - cy.wrap(orderResponse.fulfillments[0].metadata).should( - "deep.equal", - [], - ); - cy.wrap(orderResponse.fulfillments[0].privateMetadata).should( - "deep.equal", - [], - ); - }); - }); - }); - }); - }); - }, - ); - it( - "should open product details from order details - unconfirmed order. TC: SALEOR_2133", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createUnconfirmedOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(unconfirmedOrderResponse => { - cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`); - openVariantDetailsOptions(); - cy.get(ORDERS_SELECTORS.openProductDetailsButton).then( - openProductInNewTabButton => { - cy.wrap(openProductInNewTabButton) - .invoke("attr", "target") - .should("eq", "_blank"); - cy.wrap(openProductInNewTabButton) - .invoke("attr", "href") - .should("contain", productDetails.id.replace("=", "")); - }, - ); - }); - }, - ); - it( - "should open product details from order details - confirmed order. TC: 2134", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - let order; - createReadyToFulfillOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.get(ORDERS_SELECTORS.rowActionButton) - .find("a") - .then(openProductInNewTabButton => { - cy.wrap(openProductInNewTabButton) - .invoke("attr", "target") - .should("eq", "_blank"); - cy.wrap(openProductInNewTabButton) - .invoke("attr", "href") - .should("contain", productDetails.id.replace("=", "")); - }); - }); - }, - ); - it( - "should be able to turn off all but one static columns on orders detail. TC: SALEOR_2136", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - let order; - createReadyToFulfillOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethod, - variantsList, - address, - }).then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders + `${order.id}`); - cy.openColumnPicker(); - cy.get(SHARED_ELEMENTS.staticColumnContainer) - .should("contain.text", "Product") - .should("contain.text", "SKU") - .should("contain.text", "Variant") - .should("contain.text", "Quantity") - .should("contain.text", "Price") - .should("contain.text", "Total") - .should("contain.text", "Is gift") - .should("contain.text", "Metadata"); - // switching off all but one static columns - cy.get(SHARED_ELEMENTS.gridStaticSkuButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticVariantNameButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticQuantityButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticPriceButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticTotalButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticIsGiftButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticMetadataButton).click(); - cy.get(SHARED_ELEMENTS.gridStaticProductButton).should( - "have.attr", - "data-state", - "on", - ); - cy.get(SHARED_ELEMENTS.dataGridTable) - .find("th") - .should("have.length", 1) - .should("have.text", "Product"); - // next line hides picker - cy.get(SHARED_ELEMENTS.pageHeader).click({ force: true }); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer).should("not.exist"); - }); - }, - ); -}); diff --git a/cypress/e2e/orders/transactionsForOrders.js b/cypress/e2e/orders/transactionsForOrders.js deleted file mode 100644 index 94966df9e06..00000000000 --- a/cypress/e2e/orders/transactionsForOrders.js +++ /dev/null @@ -1,196 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; -import { - ONE_PERMISSION_USERS, - urlList, -} from "../../fixtures"; -import { - createChannel, - createCustomer, - getOrder, - updateChannelOrderSettings, -} from "../../support/api/requests"; -import { - createOrder, - createShipping, - getDefaultTaxClass, - productsUtils, -} from "../../support/api/utils"; -import { transactionsOrderUtils } from "../../support/pages/"; - -describe("Orders", () => { - const startsWith = "CyOrders-"; - const randomName = startsWith + faker.datatype.number(); - const randomRefNumber = startsWith + faker.datatype.number(); - const randomPSPNumber = startsWith + faker.datatype.number(); - - let customer; - let channel; - let warehouse; - let shippingMethod; - let variantsList; - let address; - let taxClass; - - before(() => { - cy.loginUserViaRequest(); - createChannel({ name: randomName }) - .then(channelResp => { - channel = channelResp; - - updateChannelOrderSettings({ - channelId: channel.id, - markAsPaidStrategy: "TRANSACTION_FLOW", - }); - getDefaultTaxClass(); - }) - .then(resp => { - taxClass = resp; - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createCustomer(`${randomName}@example.com`, randomName, address, true); - }) - .then(customerResp => { - customer = customerResp.user; - createShipping({ - channelId: channel.id, - name: randomName, - address, - taxClassId: taxClass.id, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - shippingMethod = shippingMethodResp; - warehouse = warehouseResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: randomName, - }); - }, - ) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp, - }) => { - productsUtils.createProductInChannel({ - name: randomName, - channelId: channel.id, - warehouseId: warehouse.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id, - taxClassId: taxClass.id, - price: 10, - }); - }, - ) - .then(({ variantsList: variantsResp }) => { - variantsList = variantsResp; - cy.checkIfDataAreNotNull({ - customer, - channel, - warehouse, - shippingMethod, - variantsList, - address, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.order).then(() => { - // set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test - window.localStorage.setItem("notifiedAboutNavigator", "true"); - }); - }); - - it( - "should mark order as paid. TC: 3901", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createOrder({ - customerId: customer.id, - shippingMethod, - channelId: channel.id, - variantsList, - address, - }).then(order => { - cy.visit(urlList.orders + `${order.id}`); - transactionsOrderUtils.markAsPaidOrderWithRefNumber(randomRefNumber); - cy.checkIfElementIsVisible(ORDERS_SELECTORS.orderTransactionsList); - getOrder(order.id).then(orderResp => { - expect(orderResp.paymentStatus).to.be.eq("FULLY_CHARGED"); - expect(orderResp.transactions).to.be.not.null; - }); - }); - }, - ); - - // TODO uncomment when bug: https://github.com/saleor/saleor/issues/12757 if fixed - xit( - "should be able to grant and send refund TC: 3902", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createReadyToFulfillOrder({ - customerId: customer.id, - shippingMethod, - channelId: channel.id, - variantsList, - address, - }).then(({ order: orderResp }) => { - const orderPrice = orderResp.total.gross.amount; - - cy.visit(urlList.orders + `${orderResp.id}`); - cy.checkIfElementNotExist(ORDERS_SELECTORS.markAsPaidButton); - transactionsOrderUtils.grantRefundAllProductsAndShippingWithReason( - "refund reason: wrong size", - orderPrice, - ); - transactionsOrderUtils.sendRefundWithDescriptionPSPAndAmount( - "refund description", - randomPSPNumber, - orderPrice, - ); - getOrder(orderResp.id).then(orderResp => { - expect(orderResp.paymentStatus).to.be.eq("NOT_CHARGED"); - expect(orderResp.transactions).to.be.not.null; - }); - }); - }, - ); - - it( - "should be able to capture manual transaction that covers partial order price TC: 3903", - { tags: ["@orders", "@allEnv", "@stable"] }, - () => { - createOrder({ - customerId: customer.id, - shippingMethod, - channelId: channel.id, - variantsList, - address, - }).then(order => { - const partialOrderPrice = order.total.gross.amount - 1; - - cy.visit(urlList.orders + `${order.id}`); - transactionsOrderUtils.captureManualTransaction( - "Manual capture description", - randomPSPNumber, - partialOrderPrice, - ); - getOrder(order.id).then(orderResp => { - expect(orderResp.paymentStatus).to.be.eq("PARTIALLY_CHARGED"); - expect(orderResp.transactions).to.be.not.null; - }); - }); - }, - ); -}); diff --git a/cypress/e2e/pages/pageTypes.js b/cypress/e2e/pages/pageTypes.js deleted file mode 100644 index 6558379a387..00000000000 --- a/cypress/e2e/pages/pageTypes.js +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - PAGE_TYPE_DETAILS_SELECTORS, -} from "../../elements/pageTypes/pageTypeDetails"; -import { - PAGE_TYPES_LIST_SELECTORS, -} from "../../elements/pageTypes/pageTypesList"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { - pageTypeDetailsUrl, - urlList, -} from "../../fixtures/urlList"; -import { createAttribute } from "../../support/api/requests/Attribute"; -import { - createPageType, - getPageType, -} from "../../support/api/requests/PageType"; - -describe("Tests for page types", () => { - const startsWith = "PageTypes"; - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create page type. TC: SALEOR_2301", - { tags: ["@pages", "@allEnv", "@stable"] }, - () => { - const randomName = startsWith + faker.datatype.number(); - - cy.visit(urlList.pageTypes) - .get(PAGE_TYPES_LIST_SELECTORS.createPageTypeButton) - .click() - .get(PAGE_TYPE_DETAILS_SELECTORS.nameInput) - .type(randomName) - .addAliasToGraphRequest("PageTypeCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@PageTypeCreate") - .its("response.body.data.pageTypeCreate.pageType") - .then(pageType => { - getPageType(pageType.id); - }) - .then(pageType => { - expect(pageType.name).to.eq(randomName); - }); - }, - ); - - it( - "should assign attribute. TC: SALEOR_2302", - { tags: ["@pages", "@allEnv"] }, - () => { - const randomName = startsWith + faker.datatype.number(); - - createAttribute({ name: randomName, type: "PAGE_TYPE" }); - createPageType(randomName) - .then(({ pageType }) => { - cy.visit(pageTypeDetailsUrl(pageType.id)) - .get(SHARED_ELEMENTS.progressBar) - .should("be.not.visible") - .get(PAGE_TYPE_DETAILS_SELECTORS.assignAttributesButton) - .click() - .assignElements(randomName) - .confirmationMessageShouldDisappear(); - getPageType(pageType.id); - }) - .then(pageType => { - expect(pageType.attributes[0].name).to.eq(randomName); - }); - }, - ); -}); diff --git a/cypress/e2e/pages/pages.js b/cypress/e2e/pages/pages.js deleted file mode 100644 index aab5d21ccd6..00000000000 --- a/cypress/e2e/pages/pages.js +++ /dev/null @@ -1,205 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { BUTTON_SELECTORS, PAGE_DETAILS_SELECTORS } from "../../elements"; -import { pageDetailsUrl, urlList } from "../../fixtures/urlList"; -import { - attributeRequests, - pageRequests, - pageTypeRequests, -} from "../../support/api/requests"; -import { pageDetailsPage, pagesPage } from "../../support/pages"; - -describe("Tests for pages", () => { - const startsWith = `Pages`; - const name = `${startsWith}${faker.datatype.number()}`; - let attribute; - let pageType; - let pageTypeId; - - const attributes = [ - { key: "DROPDOWN", value: "value", TC: "SALEOR_2203" }, - { key: "MULTISELECT", value: "value", TC: "SALEOR_2204" }, - { key: "RICH_TEXT", value: faker.lorem.sentence(), TC: "SALEOR_2205" }, - { key: "BOOLEAN", value: true, TC: "SALEOR_2206" }, - { key: "NUMERIC", value: 1, TC: "SALEOR_2207" }, - ]; - - before(() => { - cy.loginUserViaRequest(); - attributeRequests - .createAttribute({ name, type: "PAGE_TYPE" }) - .then(attributeResp => { - attribute = attributeResp; - pageTypeRequests.createPageType({ name, attributeId: attribute.id }); - }) - .then(({ pageType: pageTypeResp }) => { - pageType = pageTypeResp; - cy.checkIfDataAreNotNull({ attribute, pageType }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should create not published page. TC: SALEOR_2201", - { tags: ["@pages", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("PageType"); - const pageName = `${startsWith}${faker.datatype.number()}`; - cy.visit(urlList.pages); - pagesPage.openCreatePageDialog(); - pagesPage.selectPageTypeOnIndex(0); - cy.get(BUTTON_SELECTORS.confirmButton).click(); - cy.waitForRequestAndCheckIfNoErrors("@PageType"); - pageDetailsPage.typePageName(pageName).should("have.value", pageName); - cy.get(PAGE_DETAILS_SELECTORS.isNotPublishedCheckbox).click(); - pagesPage.savePage().then(page => { - pageRequests.getPage(page.id).then(page => { - expect(page.title).to.eq(pageName); - expect(page.isPublished).to.be.false; - pageRequests.getPage(page.id, "token").should("be.null"); - }); - }); - }, - ); - - it( - "should create published page. TC: SALEOR_2202", - { tags: ["@pages", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - - pagesPage - .createPage({ - pageName: randomName, - pageTypeName: name, - isPublished: true, - }) - .then(page => { - pageRequests.getPage(page.id, "token"); - }) - .then(page => { - expect(page.title).to.eq(randomName); - expect(page.isPublished).to.be.true; - expect(page.attributes[0].attribute.id).to.eq(attribute.id); - }); - }, - ); - - attributes.forEach(attributeType => { - it( - `should create page with ${attributeType.key} attribute TC: ${attributeType.TC}`, - { tags: ["@attribute", "@pages", "@allEnv"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const attributeKey = attributeType.key; - const attributeValue = attributeType.value; - attributeRequests - .createAttribute({ - name: randomName, - type: "PAGE_TYPE", - inputType: attributeKey, - attributeValues: [attributeValue], - }) - .then(attributeResp => { - attribute = attributeResp; - pageTypeRequests - .createPageType({ - name: randomName, - attributeId: attribute.id, - }) - .then(createPageResponse => { - pageTypeId = createPageResponse.pageType.id; - cy.visit(`${urlList.addPageType}${pageTypeId}`); - pagesPage - .createPageWithAttribute({ - pageName: randomName, - pageTypeName: randomName, - attributeType: attributeKey, - attributeValue: attributeValue, - }) - .then(page => { - pageRequests.getPage(page.id); - }) - .then(page => { - expect(page.attributes[0].values[0].inputType).to.eq( - attributeKey, - ); - if (attributeKey === "BOOLEAN") { - expect(page.attributes[0].values[0].name).to.includes( - "Yes".toString(), - ); - } else { - expect(page.attributes[0].values[0].name).to.eq( - attributeValue.toString(), - ); - } - }); - }); - }); - }, - ); - }); - - it( - "should delete page TC: SALEOR_2209", - { tags: ["@pages", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - - pageRequests - .createPage({ - pageTypeId: pageType.id, - title: randomName, - }) - .then(({ page }) => { - cy.visit(pageDetailsUrl(page.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("PageRemove") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@PageRemove"); - pageRequests.getPage(page.id).should("be.null"); - }); - }, - ); - - it( - "should update page TC: SALEOR_2208", - { tags: ["@pages", "@allEnv", "@stable"] }, - () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}${faker.datatype.number()}`; - - pageRequests - .createPage({ - pageTypeId: pageType.id, - title: randomName, - isPublished: true, - }) - .then(({ page }) => { - cy.visit(pageDetailsUrl(page.id)) - .get(PAGE_DETAILS_SELECTORS.nameInput) - .clear() - .type(updatedName) - .get(PAGE_DETAILS_SELECTORS.isNotPublishedCheckbox) - .click() - .addAliasToGraphRequest("PageUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@PageUpdate"); - pageRequests.getPage(page.id); - }) - .then(page => { - expect(page.title).to.eq(updatedName); - expect(page.isPublished).to.eq(false); - }); - }, - ); -}); diff --git a/cypress/e2e/products/images.js b/cypress/e2e/products/images.js deleted file mode 100644 index 09086d7499d..00000000000 --- a/cypress/e2e/products/images.js +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// - -import { - PRODUCT_DETAILS, -} from "../../elements/catalog/products/product-details"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { demoProductsNames } from "../../fixtures/products"; -import { productDetailsUrl } from "../../fixtures/urlList"; -import { getFirstProducts } from "../../support/api/requests/Product"; -import { - deleteCollectionsStartsWith, -} from "../../support/api/utils/catalog/collectionsUtils"; -import { - createNewProductWithNewDataAndDefaultChannel, - deleteProductsStartsWith, -} from "../../support/api/utils/products/productsUtils"; - -describe("Tests for images", () => { - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "Should display product image", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - getFirstProducts(1, demoProductsNames.carrotJuice) - .then(resp => { - const product = resp[0].node; - cy.visit(productDetailsUrl(product.id)) - .get(PRODUCT_DETAILS.productImage) - .find("img") - .invoke("attr", "src"); - }) - .then(imageUrl => { - cy.request(imageUrl); - }) - .then(imageResp => { - expect(imageResp.status).to.equal(200); - }); - }, - ); - - it( - "Should upload saved image", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - const name = "CyImages"; - - deleteProductsStartsWith(name); - deleteCollectionsStartsWith(name); - cy.clearSessionData().loginUserViaRequest(); - createNewProductWithNewDataAndDefaultChannel({ name }) - .then(({ product }) => { - cy.visit(productDetailsUrl(product.id)) - .waitForProgressBarToNotBeVisible() - .get(PRODUCT_DETAILS.uploadImageButton) - .click() - .get(PRODUCT_DETAILS.uploadSavedImagesButton) - .click() - .get(SHARED_ELEMENTS.fileInput) - .attachFile("images/saleorDemoProductSneakers.png") - .get(PRODUCT_DETAILS.productImage) - .find("img") - .invoke("attr", "src"); - }) - .then(imageUrl => { - cy.request(imageUrl); - }) - .then(imageResp => { - expect(imageResp.status).to.equal(200); - }); - }, - ); -}); diff --git a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js b/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js deleted file mode 100644 index 7eb133aa96b..00000000000 --- a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js +++ /dev/null @@ -1,140 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { productDetailsUrl } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { - getProductDetails, -} from "../../../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import * as shippingUtils from "../../../support/api/utils/shippingUtils"; -import { - isProductAvailableForPurchase, -} from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import { - updateProductIsAvailableForPurchase, -} from "../../../support/pages/catalog/products/productDetailsPage"; - -describe("Products available in listings", () => { - const startsWith = "CyAvailForPurchase-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; - let warehouse; - - before(() => { - cy.loginUserViaRequest(); - shippingUtils.deleteShippingStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); - - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addressesFixture => { - shippingUtils.createShipping({ - channelId: defaultChannel.id, - name, - address: addressesFixture.plAddress, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - }); - - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - cy.checkIfDataAreNotNull({ - productType, - attribute, - category, - defaultChannel, - warehouse, - }); - }, - ); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product); - }); - - it( - "should update product to available for purchase. TC: SALEOR_2501", - { tags: ["@products", "@allEnv"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - let product; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - isAvailableForPurchase: false, - }) - .then(({ product: productResp }) => { - product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductIsAvailableForPurchase(true); - }) - .then(() => { - getProductDetails(product.id, defaultChannel.slug); - }) - .then(resp => { - expect(isProductAvailableForPurchase(resp)).to.be.eq(true); - }); - }, - ); - - it( - "should update product to not available for purchase. TC: SALEOR_2502", - { tags: ["@products", "@allEnv"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - let product; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }) - .then(({ product: productResp }) => { - product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductIsAvailableForPurchase(false); - }) - .then(() => { - getProductDetails(product.id, defaultChannel.slug); - }) - .then(resp => { - expect(isProductAvailableForPurchase(resp)).to.be.eq(false); - }); - }, - ); -}); diff --git a/cypress/e2e/products/manageProducts/publishedProducts.js b/cypress/e2e/products/manageProducts/publishedProducts.js deleted file mode 100644 index 39747a65315..00000000000 --- a/cypress/e2e/products/manageProducts/publishedProducts.js +++ /dev/null @@ -1,126 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { productDetailsUrl } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { - getProductDetails, -} from "../../../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { - isProductVisible, -} from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import { - updateProductPublish, -} from "../../../support/pages/catalog/products/productDetailsPage"; - -describe("Published products", () => { - const startsWith = "CyPublishedProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - getDefaultChannel(); - }, - ) - .then(channel => { - defaultChannel = channel; - cy.checkIfDataAreNotNull({ - productType, - attribute, - category, - defaultChannel, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product); - }); - - it( - "should update product to published", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - isPublished: false, - isAvailableForPurchase: false, - }) - .then(({ product: productResp }) => { - const product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductPublish(true); - getProductDetails(product.id, defaultChannel.slug); - }) - .then(resp => { - const isVisible = isProductVisible(resp, productName); - expect(isVisible).to.be.eq(true); - }); - }, - ); - - it( - "should update product to not published", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - let product; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - }) - .then(({ product: productResp }) => { - product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductPublish(false); - getProductDetails(product.id, defaultChannel.slug); - }) - .then(resp => { - const isVisible = isProductVisible(resp, productName); - expect(isVisible).to.be.eq(false); - cy.loginInShop(); - }) - .then(() => { - getProductDetails(product.id, defaultChannel.slug); - }) - .then(resp => { - const isVisible = isProductVisible(resp, productName); - expect(isVisible).to.be.eq(true); - }); - }, - ); -}); diff --git a/cypress/e2e/products/manageProducts/visibleInListingsProducts.js b/cypress/e2e/products/manageProducts/visibleInListingsProducts.js deleted file mode 100644 index 8511fff23d0..00000000000 --- a/cypress/e2e/products/manageProducts/visibleInListingsProducts.js +++ /dev/null @@ -1,123 +0,0 @@ -/// -/// -import faker from "faker"; - -import { productDetailsUrl } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { - expectProductVisibleInShop, - searchInShop, -} from "../../../support/api/requests/storeFront/Search"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import { isProductVisibleInSearchResult } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import { updateProductVisibleInListings } from "../../../support/pages/catalog/products/productDetailsPage"; - -describe("Products displayed in listings", () => { - const startsWith = "CyVisibleInListings-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; - - before(() => { - cy.loginUserViaRequest(); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - getDefaultChannel(); - }, - ) - .then(channel => { - defaultChannel = channel; - cy.checkIfDataAreNotNull({ - productType, - attribute, - category, - defaultChannel, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product); - }); - - it( - "should update product to be visible in listings. TC: SALEOR_2505", - { tags: ["@products", "@allEnv"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false, - isAvailableForPurchase: false, - }) - .then(({ product: productResp }) => { - const product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductVisibleInListings(); - searchInShop(productName); - }) - .then(resp => { - const isProductVisible = isProductVisibleInSearchResult( - resp, - productName, - ); - expect(isProductVisible).to.be.eq(true); - }); - }, - ); - - it( - "should update product to not be visible in listings. TC: SALEOR_2506", - { tags: ["@products", "@allEnv"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: true, - }) - .then(({ product: productResp }) => { - const product = productResp; - const productUrl = productDetailsUrl(product.id); - cy.visit(productUrl); - updateProductVisibleInListings(); - - searchInShop(productName).then(resp => { - const isProductVisible = isProductVisibleInSearchResult( - resp, - productName, - ); - expect(isProductVisible).to.be.eq(false); - }); - cy.loginInShop(); - }) - .then(() => { - expectProductVisibleInShop(productName); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/columnPicker.js b/cypress/e2e/products/productsList/columnPicker.js deleted file mode 100644 index 7513f77f24c..00000000000 --- a/cypress/e2e/products/productsList/columnPicker.js +++ /dev/null @@ -1,133 +0,0 @@ -/// -/// - -import { SHARED_ELEMENTS } from "../../../elements"; -import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; -import { LOCAL_STORAGE_FOR_COLUMN_PICKER } from "../../../fixtures"; -import { urlList } from "../../../fixtures/urlList"; -import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas"; -import { columnPickerPage } from "../../../support/pages"; - -describe("As an admin I should be able to use column picker", () => { - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to add new dynamic column to grid on product list via search. TC: SALEOR_2610 should not be migrated to playwright as critical", - { tags: ["@critical", "@allEnv", "@stable"] }, - () => { - const dynamicColumnToBeSearched = "ABV"; - cy.addAliasToGraphRequest("AvailableColumnAttributes"); - cy.visit(urlList.products); - - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - columnPickerPage.openColumnPicker(); - columnPickerPage.openDynamicColumnsSearch(); - columnPickerPage.typeNameInSearchColumnInput(dynamicColumnToBeSearched); - cy.waitForRequestAndCheckIfNoErrors("@AvailableColumnAttributes"); - cy.get(SHARED_ELEMENTS.dynamicColumnSelector) - .should("have.length", 1) - .should("contain.text", dynamicColumnToBeSearched) - .find("button") - .click(); - cy.get(SHARED_ELEMENTS.dynamicColumnSelector) - .invoke("text") - .then(selectedColumnName => { - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - // do not check by visible text just data-test-id since often text has ellipsis - .find(`[data-test-id="column-name-${selectedColumnName}"]`) - .should("be.visible"); - // newly added dynamic column is alway placed as last one on grid - cy.get(SHARED_ELEMENTS.dataGridTable) - .find("th") - .last() - .should("have.text", selectedColumnName); - }); - }, - ); - it( - "should be able to remove dynamic column from picker on products list. TC: SALEOR_2611", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - const listConfigLocalStorage = JSON.stringify( - LOCAL_STORAGE_FOR_COLUMN_PICKER.listConfigWithAttributeColumnPicker, - ); - // local storage is updated to avoid not necessary action of adding dynamic column in the beginning of test - cy.window().then(win => { - win.localStorage.setItem("listConfig", listConfigLocalStorage); - }); - cy.visit(urlList.products); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - columnPickerPage.openColumnPicker(); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - .find(SHARED_ELEMENTS.selectedDynamicColumnNameSelector) - .should("have.length", 1) - .invoke("text") - .then(columnName => { - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - .find(SHARED_ELEMENTS.removeSelectedDynamicColumnButton) - .should("be.visible") - .should("have.length", 1) - .click(); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - .find(SHARED_ELEMENTS.removeSelectedDynamicColumnButton) - .should("not.exist"); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - .find(columnName) - .should("not.exist"); - }); - }, - ); - it( - "should validate: that there is always at least one active static column, use pagination when searching dynamic columns, hiding column picker works. TC: SALEOR_2612", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("ProductDetails"); - // local storage accepts only strings - const listConfigLocalStorage = JSON.stringify( - LOCAL_STORAGE_FOR_COLUMN_PICKER.localStorageWithSingleStaticColumn, - ); - // local storage is updated to make sure only one static column is active - cy.window().then(win => { - win.localStorage.setItem("listConfig", listConfigLocalStorage); - }); - cy.visit(urlList.products); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - columnPickerPage.openColumnPicker(); - cy.get(SHARED_ELEMENTS.activeStaticColumnOnGridButton).should( - "have.length", - 1, - "There should be only one active static column", - ); - columnPickerPage.openDynamicColumnsSearch(); - - cy.get(SHARED_ELEMENTS.paginationBackOnColumnPicker).should( - "have.attr", - "disabled", - ); - cy.get(SHARED_ELEMENTS.paginationForwardOnColumnPicker).click(); - cy.get(SHARED_ELEMENTS.paginationBackOnColumnPicker).should( - "not.have.attr", - "disabled", - ); - columnPickerPage - .selectDynamicColumnAtIndex(1) - .invoke("text") - .then(selectedColumnName => { - cy.get(SHARED_ELEMENTS.dynamicColumnContainer) - // do not check by visible text just data-test-id since often text has ellipsis - .find(`[data-test-id*="${selectedColumnName}"]`) - .should("be.visible"); - // newly added dynamic column is alway placed as last one on grid - cy.get(SHARED_ELEMENTS.dataGridTable) - .find("th") - .last() - .should("have.text", selectedColumnName); - //next line hides picker - cy.get(SHARED_ELEMENTS.pageHeader).click({ force: true }); - cy.get(SHARED_ELEMENTS.dynamicColumnContainer).should("not.exist"); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/deleteProducts.js b/cypress/e2e/products/productsList/deleteProducts.js deleted file mode 100644 index a0ab392688a..00000000000 --- a/cypress/e2e/products/productsList/deleteProducts.js +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// -import faker from "faker"; - -import { - BUTTON_SELECTORS, - PRODUCTS_LIST, -} from "../../../elements/"; -import { MESSAGES } from "../../../fixtures/"; -import { urlList } from "../../../fixtures/urlList"; -import { - getDefaultChannel, - productsUtils, -} from "../../../support/api/utils/"; -import { - ensureCanvasStatic, -} from "../../../support/customCommands/sharedElementsOperations/canvas"; - -describe("Test for deleting products", () => { - const startsWith = "AABulkDeleteCypress"; - const name = `${startsWith}${faker.datatype.number()}`; - const name2 = `${startsWith}${faker.datatype.number()}`; - let channel; - let product; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channelResp => { - channel = channelResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, category, productType }) => { - productsUtils.createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: channel.id, - name, - productTypeId: productType.id, - }); - productsUtils.createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: channel.id, - name: name2, - productTypeId: productType.id, - }); - }) - .then(({ product: productResp }) => { - product = productResp; - cy.checkIfDataAreNotNull({ channel, product }); - }); - }); - - it( - "should delete 2 first products on products grid view - SALEOR_2715", - { tags: ["@metadata", "@allEnv", "@stable"] }, - () => { - cy.clearSessionData().loginUserViaRequest(); - cy.visit(urlList.products); - // checks two first rows on products data grid - cy.clickGridCell(0, 0); - cy.clickGridCell(0, 1); - cy.clickOnElement(BUTTON_SELECTORS.deleteProductsButton); - cy.contains(MESSAGES.confirmProductsDeletion).should("be.visible"); - cy.addAliasToGraphRequest("productBulkDelete") - .clickSubmitButton() - .waitForRequestAndCheckIfNoErrors("@productBulkDelete"); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - cy.get(BUTTON_SELECTORS.submit).should("not.exist"); - cy.contains(name).should("not.exist"); - cy.contains(name2).should("not.exist"); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/filteringProducts.js b/cypress/e2e/products/productsList/filteringProducts.js deleted file mode 100644 index 002aeb1fd79..00000000000 --- a/cypress/e2e/products/productsList/filteringProducts.js +++ /dev/null @@ -1,135 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { SHARED_ELEMENTS } from "../../../elements"; -import { urlList } from "../../../fixtures/urlList"; -import { createCollection } from "../../../support/api/requests/Collections"; -import { updateProduct } from "../../../support/api/requests/Product"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../../support/api/utils/products/productsUtils"; -import { createShipping } from "../../../support/api/utils/shippingUtils"; -import { - filterProductsWithNewFilters, - selectChannel, - selectProductsOutOfStock, -} from "../../../support/pages/catalog/products/productsListPage"; - -/* - Todo: https://github.com/saleor/saleor-dashboard/issues/4300 -*/ -describe("As an admin I should be able to filter products", () => { - const startsWith = "ACyFilterProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - const stockQuantity = 747; - const price = 342; - let attribute; - let productType; - let category; - let warehouse; - let channel; - let collection; - - before(() => { - cy.loginUserViaRequest(); - createTypeAttributeAndCategoryForProduct({ name }).then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - attribute = attributeResp; - productType = productTypeResp; - category = categoryResp; - }, - ); - createCollection(name).then( - collectionResp => (collection = collectionResp), - ); - getDefaultChannel() - .then(channelResp => { - channel = channelResp; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: channel.id, - name, - address: addresses.plAddress, - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - createProductInChannel({ - name, - channelId: channel.id, - warehouseId: warehouse.id, - quantityInWarehouse: stockQuantity, - price, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - }); - }) - .then(({ product: product }) => { - updateProduct(product.id, { collections: [collection.id] }); - cy.checkIfDataAreNotNull({ - attribute, - productType, - category, - warehouse, - channel, - collection, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest().visit(urlList.products); - }); - - const filterProductsBy = [ - { type: "Category", testCase: "SALEOR_2601" }, - { type: "Product type", testCase: "SALEOR_2602" }, - { type: "Collection", testCase: "SALEOR_2603" }, - ]; - filterProductsBy.forEach(filterBy => { - it( - `should filter products by ${filterBy.type}. TC: ${filterBy.testCase}`, - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("ProductList"); - filterProductsWithNewFilters(filterBy.type, name); - cy.get(SHARED_ELEMENTS.dataGridTable).contains(name).should("exist"); - }, - ); - }); - - it.skip( - "should filter products out of stock. TC: SALEOR_2604", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - const productOutOfStock = `${startsWith}${faker.datatype.number()}`; - cy.addAliasToGraphRequest("ProductList"); - createProductInChannel({ - name: productOutOfStock, - channelId: channel.id, - warehouseId: warehouse.id, - quantityInWarehouse: 0, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price, - }); - selectChannel(channel.slug); - selectProductsOutOfStock(); - cy.get(SHARED_ELEMENTS.dataGridTable) - .contains(productOutOfStock) - .should("exist"); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/pagination.js b/cypress/e2e/products/productsList/pagination.js deleted file mode 100644 index 8d755d3ee31..00000000000 --- a/cypress/e2e/products/productsList/pagination.js +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// - -import { PAGINATION } from "../../../elements"; -import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; -import { urlList } from "../../../fixtures/urlList"; -import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas"; - -describe("As an admin I should be able to manage products table", () => { - beforeEach(() => { - cy.loginUserViaRequest(); - cy.visit(urlList.products); - }); - - it( - "should be able go to the next page and back on product list. TC: SALEOR_2605", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.assertCanvasRowsNumber(PRODUCTS_LIST.dataGridTable, 21); - }); - cy.get(PAGINATION.previousPagePaginationButton).should("be.disabled"); - - cy.addAliasToGraphRequest("ProductList") - .get(PAGINATION.nextPagePaginationButton) - .should("not.be.disabled") - .click() - .wait("@ProductList"); - - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.assertCanvasRowsNumber(PRODUCTS_LIST.dataGridTable, 21); - }); - cy.get(PAGINATION.previousPagePaginationButton) - .should("not.be.disabled") - .click() - .wait("@ProductList") - .get(PAGINATION.previousPagePaginationButton) - .should("be.disabled") - .get(PAGINATION.nextPagePaginationButton) - .should("not.be.disabled"); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.get(PRODUCTS_LIST.dataGridTable) - .find("tr") - .should("have.length.above", 10); - }); - }, - ); - - it( - "should see correct amount of products per page. TC: SALEOR_2606", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.addAliasToGraphRequest("ProductList"); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.getRowNumberButton().should("contain.text", 20); - cy.assertCanvasRowsNumber(PRODUCTS_LIST.dataGridTable, 21); - }); - cy.clickRowNumberButton(); - cy.getRowSelectorWithNumber(30).click().wait("@ProductList"); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.get(PRODUCTS_LIST.resultsOnPageSelect).should("contain.text", 30); - cy.assertCanvasRowsNumber(PRODUCTS_LIST.dataGridTable, 31); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/productPresets.js b/cypress/e2e/products/productsList/productPresets.js deleted file mode 100644 index 47a76f62f6a..00000000000 --- a/cypress/e2e/products/productsList/productPresets.js +++ /dev/null @@ -1,97 +0,0 @@ -/// -/// - -import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; -import { PRESETS, SEARCH } from "../../../elements/shared"; -import { LOCAL_STORAGE_KEYS, urlList } from "../../../fixtures/"; -import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas"; -import { - addPresetWithName, - clickDeletePresetButton, - clickSavedPresetContain, - clickShowSavedPresetsButton, - clickUpdatePresetButton, - confirmActivePresetName, - confirmGridRowsContainsText, - hoverSavedPresetContain, - searchItems, -} from "../../../support/pages/catalog/presetsAndSearch"; - -describe("As a user I should be able to save selected filters with search queries under the given name", () => { - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to add preset. TC: SALEOR_2712", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.visit(urlList.products); - - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - cy.assertCanvasRowsNumber(PRODUCTS_LIST.dataGridTable, 21); - }); - const presetName = "hoodie"; - - searchItems(presetName); - addPresetWithName(presetName); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - confirmGridRowsContainsText(presetName); - confirmActivePresetName(presetName); - }); - }, - ); - it( - "should be able to update preset. TC: SALEOR_2713", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - const searchQuery = "bean"; - // space is needed since we add second part of query into input - const updatedSearchQuery = " juice"; - window.localStorage.setItem( - LOCAL_STORAGE_KEYS.keys.productPresets, - `[{"data":"query=${searchQuery}","name":"${searchQuery}"}]`, - ); - cy.visit(urlList.products); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - clickShowSavedPresetsButton(); - clickSavedPresetContain(searchQuery); - cy.get(SEARCH.searchInput).click().type(updatedSearchQuery); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - clickUpdatePresetButton(); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - expect( - localStorage.getItem(LOCAL_STORAGE_KEYS.keys.productPresets), - ).to.contains(`query=${searchQuery}%20${updatedSearchQuery.trim()}`); - }); - }, - ); - it( - "should be able to delete preset. TC: SALEOR_2714", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - const firstPreset = "bean"; - const secondPreset = "hoodie"; - window.localStorage.setItem( - LOCAL_STORAGE_KEYS.keys.productPresets, - `[{"data":"query=${firstPreset}","name":"${firstPreset}"},{"data":"query=${secondPreset}","name":"${secondPreset}"}]`, - ); - cy.visit(urlList.products); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable); - clickShowSavedPresetsButton(); - hoverSavedPresetContain(secondPreset); - clickDeletePresetButton(); - cy.clickSubmitButton(); - ensureCanvasStatic(PRODUCTS_LIST.dataGridTable).then(() => { - expect( - localStorage.getItem(LOCAL_STORAGE_KEYS.keys.productPresets), - ).to.contains(`query=${firstPreset}`); - expect( - localStorage.getItem(LOCAL_STORAGE_KEYS.keys.productPresets), - ).to.not.contains(`query=${secondPreset}`); - clickShowSavedPresetsButton(); - cy.get(PRESETS.savedPreset).contains(firstPreset).should("be.visible"); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/productsView.js b/cypress/e2e/products/productsList/productsView.js deleted file mode 100644 index b0d44e50cb0..00000000000 --- a/cypress/e2e/products/productsList/productsView.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import { - PRODUCTS_LIST, -} from "../../../elements/catalog/products/products-list"; -import { urlList } from "../../../fixtures/urlList"; -import { - changeToDatagridView, - changeToTileView, -} from "../../../support/pages/catalog/products/productsListPage"; - -describe("As an user I should be able switch between product views", () => { - beforeEach(() => { - cy.loginUserViaRequest().then(() => { - // set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test - window.localStorage.setItem("notifiedAboutNavigator", "true"); - }); - cy.visit(urlList.products); - }); - - it( - "should be able to switch between products view TC: SALEOR_2610", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.get(PRODUCTS_LIST.datagridViewButton) - .invoke("attr", "data-state") - .should("eq", "checked"); - changeToTileView(); - cy.checkIfElementIsVisible(PRODUCTS_LIST.tileProductsView); - cy.get(PRODUCTS_LIST.dataGridTable).should("not.exist"); - changeToDatagridView(); - cy.checkIfElementIsVisible(PRODUCTS_LIST.dataGridTable); - cy.get(PRODUCTS_LIST.tileProductsView).should("not.exist"); - }, - ); -}); diff --git a/cypress/e2e/products/productsList/sortingProducts.js b/cypress/e2e/products/productsList/sortingProducts.js deleted file mode 100644 index 6adbd2f84f0..00000000000 --- a/cypress/e2e/products/productsList/sortingProducts.js +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// - -import { - PRODUCTS_LIST, -} from "../../../elements/catalog/products/products-list"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; -import { urlList } from "../../../fixtures/urlList"; -import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; -import { - selectChannel, - sortProductsBy, - submitFilters, -} from "../../../support/pages/catalog/products/productsListPage"; - -// waiting for canvas fix https://github.com/saleor/saleor-dashboard/issues/3410 -describe.skip("As an admin I should be able to sort products", () => { - let defaultChannel; - - beforeEach(() => { - cy.loginUserViaRequest() - .visit(urlList.products) - .get(SHARED_ELEMENTS.header) - .should("be.visible"); - }); - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel().then(channel => { - defaultChannel = channel; - cy.checkIfDataAreNotNull({ defaultChannel }); - }); - }); - - it( - "should be able to sort products by price. TC: SALEOR_2607", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - selectChannel(defaultChannel.slug); - submitFilters(); - cy.get(PRODUCTS_LIST.tableHeaders.price) - .click() - .waitForProgressBarToNotExist(); - sortProductsBy("price"); - }, - ); - - it( - "should be able to sort products by type. TC: SALEOR_2608", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - cy.get(PRODUCTS_LIST.tableHeaders.type) - .click() - .waitForProgressBarToNotExist(); - sortProductsBy("type"); - }, - ); - - it( - "should be able to sort products by name. TC: SALEOR_2609", - { tags: ["@productsList", "@allEnv", "@stable"] }, - () => { - sortProductsBy("name"); - }, - ); -}); diff --git a/cypress/e2e/products/productsVariants.js b/cypress/e2e/products/productsVariants.js deleted file mode 100644 index f2b0e99a29c..00000000000 --- a/cypress/e2e/products/productsVariants.js +++ /dev/null @@ -1,154 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { urlList } from "../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../fixtures/users"; -import { createChannel } from "../../support/api/requests/Channels"; -import { - createProduct, - updateChannelInProduct, -} from "../../support/api/requests/Product"; -import * as productUtils from "../../support/api/utils/products/productsUtils"; -import { getProductVariants } from "../../support/api/utils/storeFront/storeFrontProductUtils"; -import { - addVariantToDataGrid, - enterVariantEditPage, -} from "../../support/pages/catalog/products/productDetailsPage"; -import { - createVariant, - selectChannelsForVariant, -} from "../../support/pages/catalog/products/VariantsPage"; - -describe("As an admin I should be able to create variant", () => { - const startsWith = "CyCreateVariants-"; - const attributeValues = ["value1", "value2"]; - - let defaultChannel; - let warehouse; - let attribute; - let productType; - let category; - let newChannel; - - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; - - cy.loginUserViaRequest(); - - productUtils - .createShippingProductTypeAttributeAndCategory(name, attributeValues) - .then(resp => { - attribute = resp.attribute; - productType = resp.productType; - category = resp.category; - defaultChannel = resp.defaultChannel; - warehouse = resp.warehouse; - - createChannel({ isActive: true, name, currencyCode: "PLN" }); - }) - .then(resp => { - newChannel = resp; - }); - cy.checkIfDataAreNotNull({ - defaultChannel, - warehouse, - attribute, - productType, - category, - newChannel, - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product); - }); - - it( - "should be able to create variant visible for the customers in all channels. TC: SALEOR_2901", - { tags: ["@variants", "@allEnv", "@stable", "@oldRelease"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const price = 10; - let createdProduct; - // TODO fix name for proper one when problem with typing in grid will be solved - now only first letter of string is able to be typed in grid cell - const variantName = "A"; - - createProduct({ - attributeId: attribute.id, - name, - productTypeId: productType.id, - categoryId: category.id, - }) - .then(resp => { - createdProduct = resp; - - updateChannelInProduct({ - productId: createdProduct.id, - channelId: defaultChannel.id, - }); - updateChannelInProduct({ - productId: createdProduct.id, - channelId: newChannel.id, - }); - cy.visit( - `${urlList.products}${createdProduct.id}`, - ).waitForProgressBarToNotBeVisible(); - addVariantToDataGrid(variantName); - enterVariantEditPage(); - selectChannelsForVariant(); - cy.addAliasToGraphRequest("VariantUpdate"); - createVariant({ - channelName: [defaultChannel.name, newChannel.name], - sku: name, - price, - attributeName: attributeValues[0], - }); - cy.wait("@VariantUpdate"); - getProductVariants(createdProduct.id, defaultChannel.slug); - }) - .then(([variant]) => { - expect(variant).to.have.property("name", variantName); - expect(variant).to.have.property("price", price); - expect(variant).to.have.property("currency", "USD"); - getProductVariants(createdProduct.id, newChannel.slug); - }) - .then(([variant]) => { - expect(variant).to.have.property("name", variantName); - expect(variant).to.have.property("price", price); - expect(variant).to.have.property("currency", "PLN"); - }); - }, - ); - it( - "should be able to create variant. TC: SALEOR_2900", - { tags: ["@variants", "@allEnv", "@critical", "@stable", "@oldRelease"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - let createdProduct; - - createProduct({ - attributeId: attribute.id, - name, - productTypeId: productType.id, - categoryId: category.id, - }).then(resp => { - createdProduct = resp; - - updateChannelInProduct({ - productId: createdProduct.id, - channelId: defaultChannel.id, - }); - updateChannelInProduct({ - productId: createdProduct.id, - channelId: newChannel.id, - }); - cy.visit( - `${urlList.products}${createdProduct.id}`, - ).waitForProgressBarToNotBeVisible(); - addVariantToDataGrid(name); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js b/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js deleted file mode 100644 index 77b0b67caad..00000000000 --- a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js +++ /dev/null @@ -1,224 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - BUTTON_SELECTORS, - PRODUCT_DETAILS, - PRODUCTS_LIST, -} from "../../../elements/"; -import { - ONE_PERMISSION_USERS, - urlList, -} from "../../../fixtures/"; -import { - productsRequests, - productsTypeRequests, -} from "../../../support/api/requests/"; -import { - ordersUtils, - productsUtils, - shippingUtils, - storeFrontProductsUtils, - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/"; -import { - channelsPage, - priceListComponent, - productDetailsPage, - variantsPage, -} from "../../../support/pages"; - -describe("Creating variants", () => { - const startsWith = "CreateProdSku"; - const attributeValues = ["value1", "value2"]; - - let defaultChannel; - let warehouse; - let attribute; - let productType; - let simpleProductType; - let category; - let shippingMethod; - let address; - - before(() => { - cy.loginUserViaRequest(); - const name = `${startsWith}${faker.datatype.number()}`; - const simpleProductTypeName = `${startsWith}${faker.datatype.number()}`; - - cy.fixture("addresses").then(fixtureAddresses => { - address = fixtureAddresses.plAddress; - }); - - shippingUtils - .createShippingWithDefaultChannelAndAddress(name) - .then(resp => { - category = resp.category; - defaultChannel = resp.defaultChannel; - warehouse = resp.warehouse; - shippingMethod = resp.shippingMethod; - - updateTaxConfigurationForChannel({ - channelSlug: defaultChannel.slug, - pricesEnteredWithTax: true, - }); - }); - - productsUtils - .createTypeAttributeAndCategoryForProduct({ name, attributeValues }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp, - }) => { - attribute = attributeResp; - productType = productTypeResp; - category = categoryResp; - productsTypeRequests.createTypeProduct({ - name: simpleProductTypeName, - attributeId: attribute.id, - hasVariants: false, - }); - }, - ) - .then(type => { - simpleProductType = type; - cy.checkIfDataAreNotNull({ - defaultChannel, - warehouse, - attribute, - productType, - simpleProductType, - category, - shippingMethod, - address, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product); - }); - - it( - "should create variant without sku TC: SALEOR_2807", - { tags: ["@products", "@allEnv"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const variants = [{ price: 7 }, { name: attributeValues[1], price: 16 }]; - let createdProduct; - - productsUtils - .createProductInChannel({ - name, - attributeId: attribute.id, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - categoryId: category.id, - price: variants[0].price, - }) - .then(({ product: productResp }) => { - createdProduct = productResp; - cy.visit(`${urlList.products}${createdProduct.id}`); - productDetailsPage.enterVariantEditPage(); - cy.get(PRODUCT_DETAILS.addVariantButton) - .click() - .then(() => { - variantsPage.createVariant({ - attributeName: variants[1].name, - price: variants[1].price, - channelName: defaultChannel.name, - warehouseId: warehouse.id, - variantName: name, - }); - }); - }) - .then(() => { - storeFrontProductsUtils.getProductVariants( - createdProduct.id, - defaultChannel.slug, - ); - }) - .then(([firstVariant, secondVariant]) => { - expect(secondVariant).to.have.property("price", variants[0].price); - expect(firstVariant).to.have.property("name", name); - expect(firstVariant).to.have.property("price", variants[1].price); - ordersUtils.createWaitingForCaptureOrder({ - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList: [firstVariant], - shippingMethodName: shippingMethod.name, - address, - }); - }) - .then(({ order }) => { - expect(order.id).to.be.ok; - }); - }, - ); - - it( - "should create simple product without sku SALEOR_2808", - { tags: ["@products", "@allEnv"] }, - () => { - const name = `${startsWith}${faker.datatype.number()}`; - const prices = { sellingPrice: 10, costPrice: 6 }; - cy.addAliasToGraphRequest("VariantUpdate"); - cy.addAliasToGraphRequest("VariantCreate"); - - cy.visit(urlList.products).get(PRODUCTS_LIST.createProductBtn).click(); - productDetailsPage.fillUpProductTypeDialog({ - productType: simpleProductType.name, - }); - cy.get(BUTTON_SELECTORS.submit) - .click() - .get(PRODUCT_DETAILS.productNameInput) - .type(name, { force: true }) - .fillAutocompleteSelect(PRODUCT_DETAILS.categoryInput); - channelsPage.selectChannelInDetailsPages(defaultChannel.name); - priceListComponent.fillUpPriceList(prices.sellingPrice); - priceListComponent.fillUpPriceList( - prices.costPrice, - priceListComponent.priceInputLists.costPrice, - ); - cy.get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .wait("@VariantCreate") - .then(({ response }) => { - const variantId = - response.body.data.productVariantCreate.productVariant.id; - productsRequests.updateVariantWarehouse({ - variantId, - warehouseId: warehouse.id, - quantity: 10, - }); - }); - productDetailsPage.enterVariantEditPage(); - variantsPage.selectChannelsForVariant(); - cy.get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .wait("@VariantUpdate") - .then(({ response }) => { - const variants = [ - response.body.data.productVariantUpdate.productVariant, - ]; - ordersUtils - .createWaitingForCaptureOrder({ - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList: variants, - shippingMethodName: shippingMethod.name, - address, - }) - .its("order.id") - .should("be.ok"); - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js b/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js deleted file mode 100644 index 41bd9894128..00000000000 --- a/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js +++ /dev/null @@ -1,53 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { createCustomer } from "../../../support/api/requests/Customer"; -import { createReadyToFulfillOrder } from "../../../support/api/utils/ordersUtils"; -import { createProductWithShipping } from "../../../support/api/utils/products/productsUtils"; - -const name = `ProductsWithoutSkuInOrder${faker.datatype.number()}`; - -describe("As an admin I should be able to create order with variant without SKU", () => { - it( - "should create order with variant product without sku. SALEOR_2801", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - let variants; - let channel; - let shippingMethod; - let address; - - cy.clearSessionData().loginUserViaRequest(); - createProductWithShipping({ name, sku: null }) - .then( - ({ - variantsList, - defaultChannel, - shippingMethod: shippingMethodResp, - address: addressResp, - }) => { - variants = variantsList; - channel = defaultChannel; - shippingMethod = shippingMethodResp; - address = addressResp; - createCustomer(`${name}@example.com`, name, address, true); - }, - ) - .then(customerResp => { - const customer = customerResp.user; - createReadyToFulfillOrder({ - address, - channelId: channel.id, - customerId: customer.id, - shippingMethod, - variantsList: variants, - }); - }) - .then(({ errors }) => { - expect(errors, "check if no errors").to.be.empty; - }); - }, - ); -}); diff --git a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js b/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js deleted file mode 100644 index 31e94058067..00000000000 --- a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js +++ /dev/null @@ -1,267 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - VARIANTS_SELECTORS, -} from "../../../elements/catalog/products/variants-selectors"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; -import { productVariantDetailUrl } from "../../../fixtures/urlList"; -import { - createVariant, - createVariantForSimpleProduct, - getVariant, - updateChannelPriceInVariant, -} from "../../../support/api/requests/Product"; -import { createTypeProduct } from "../../../support/api/requests/ProductType"; -import { - createWaitingForCaptureOrder, -} from "../../../support/api/utils/ordersUtils"; -import * as productUtils - from "../../../support/api/utils/products/productsUtils"; -import * as shippingUtils from "../../../support/api/utils/shippingUtils"; -import { - deleteWarehouseStartsWith, -} from "../../../support/api/utils/warehouseUtils"; - -describe("Updating products without sku", () => { - const startsWith = "UpdateProductsSku"; - - let defaultChannel; - let address; - let warehouse; - let shippingMethod; - let attribute; - let category; - let productTypeWithVariants; - let productTypeWithoutVariants; - let product; - - const name = `${startsWith}${faker.datatype.number()}`; - const productTypeWithoutVariantsName = `${startsWith}${faker.datatype.number()}`; - const email = "example@example.com"; - const attributeValues = ["value1", "value2"]; - - before(() => { - cy.loginUserViaRequest(); - productUtils.deleteProductsStartsWith(startsWith); - shippingUtils.deleteShippingStartsWith(startsWith); - deleteWarehouseStartsWith(startsWith); - - cy.fixture("addresses").then(fixtureAddresses => { - address = fixtureAddresses.plAddress; - }); - productUtils - .createShippingProductTypeAttributeAndCategory(name, attributeValues) - .then(resp => { - cy.log(resp); - attribute = resp.attribute; - productTypeWithVariants = resp.productType; - category = resp.category; - defaultChannel = resp.defaultChannel; - warehouse = resp.warehouse; - shippingMethod = resp.shippingMethod; - - createTypeProduct({ - name: productTypeWithoutVariantsName, - attributeId: attribute.id, - hasVariants: false, - }); - }) - .then(productTypeResp => { - productTypeWithoutVariants = productTypeResp; - productUtils.createProductInChannelWithoutVariants({ - name, - channelId: defaultChannel.id, - attributeId: attribute.id, - productTypeId: productTypeWithVariants.id, - categoryId: category.id, - }); - }) - .then(productResp => { - product = productResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - address, - warehouse, - shippingMethod, - attribute, - category, - productTypeWithVariants, - productTypeWithoutVariants, - product, - }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - it( - "should be able to add SKU to simple product TC: SALEOR_2802", - { tags: ["@products", "@allEnv"] }, - () => { - const productName = `${startsWith}${faker.datatype.number()}`; - const sku = `Sku${faker.datatype.number()}`; - let product; - let variant; - - const productData = { - name: productName, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productTypeWithoutVariants.id, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - quantityInWarehouse: 10, - trackInventory: false, - }; - createSimpleProductWithVariant(productData).then(resp => { - product = resp.product; - variant = resp.variant; - - cy.visitAndWaitForProgressBarToDisappear( - productVariantDetailUrl(product.id, variant.id), - ) - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(VARIANTS_SELECTORS.skuTextField) - .scrollIntoView() - .type(sku, { force: true }) - .addAliasToGraphRequest("VariantUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@VariantUpdate") - .then(({ response }) => { - const responseSku = - response.body.data.productVariantUpdate.productVariant.sku; - expect(responseSku).to.equal(sku); - }); - }); - }, - ); - - it( - "should add sku to variant TC: SALEOR_2803", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - const sku = "NewSku"; - let variant; - createVariant({ - attributeId: attribute.id, - channelId: defaultChannel.id, - productId: product.id, - quantityInWarehouse: 10, - warehouseId: warehouse.id, - attributeName: attributeValues[0], - }) - .then(variantResp => { - variant = variantResp[0]; - cy.visitAndWaitForProgressBarToDisappear( - productVariantDetailUrl(product.id, variant.id), - ) - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(VARIANTS_SELECTORS.skuTextField) - .type(sku, { force: true }) - .addAliasToGraphRequest("VariantUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@VariantUpdate"); - getVariant(variant.id, defaultChannel.slug); - }) - .then(variantResp => { - expect(variantResp.sku).to.equal(sku); - }); - }, - ); - - it( - "should remove sku from variant TC: SALEOR_2805", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - let variant; - createVariant({ - attributeId: attribute.id, - channelId: defaultChannel.id, - productId: product.id, - quantityInWarehouse: 10, - warehouseId: warehouse.id, - sku: name, - attributeName: attributeValues[1], - }) - .then(variantResp => { - variant = variantResp[0]; - cy.visitAndWaitForProgressBarToDisappear( - productVariantDetailUrl(product.id, variant.id), - ) - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(VARIANTS_SELECTORS.skuTextField) - .clear() - .addAliasToGraphRequest("VariantUpdate") - .get(VARIANTS_SELECTORS.variantNameInput) - .type(name) - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@VariantUpdate"); - getVariant(variant.id, defaultChannel.slug); - }) - .then(variantResp => { - expect(variantResp.sku).to.be.null; - checkIfCheckoutForVariantCanBeCompleted(variantResp); - }); - }, - ); - - function checkIfCheckoutForVariantCanBeCompleted(variant) { - createWaitingForCaptureOrder({ - address, - channelSlug: defaultChannel.slug, - email, - shippingMethodName: shippingMethod.name, - variantsList: [variant], - }).then(({ order }) => { - expect(order.id).to.be.ok; - }); - } - - function createSimpleProductWithVariant({ - name, - channelId, - warehouseId = null, - quantityInWarehouse = 10, - productTypeId, - attributeId, - categoryId, - trackInventory = true, - }) { - let product; - let variant; - - return productUtils - .createProductInChannelWithoutVariants({ - name, - channelId, - productTypeId, - attributeId, - categoryId, - }) - .then(productResp => { - product = productResp; - createVariantForSimpleProduct({ - productId: product.id, - warehouseId, - quantityInWarehouse, - trackInventory, - }); - }) - .then(variantResp => { - variant = variantResp; - updateChannelPriceInVariant(variant.id, defaultChannel.id); - }) - .then(() => ({ product, variant })); - } -}); diff --git a/cypress/e2e/products/updatingProducts.js b/cypress/e2e/products/updatingProducts.js deleted file mode 100644 index 19f9434f830..00000000000 --- a/cypress/e2e/products/updatingProducts.js +++ /dev/null @@ -1,169 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - PRODUCT_DETAILS, -} from "../../elements/catalog/products/product-details"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { productDetailsUrl } from "../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../fixtures/users"; -import { createCategory } from "../../support/api/requests/Category"; -import { createCollection } from "../../support/api/requests/Collections"; -import { - getProductDetails, -} from "../../support/api/requests/storeFront/ProductDetails"; -import { getDefaultChannel } from "../../support/api/utils/channelsUtils"; -import { - expectCorrectProductInformation, -} from "../../support/api/utils/products/checkProductInfo"; -import { - createProductInChannel, - createTypeAttributeAndCategoryForProduct, -} from "../../support/api/utils/products/productsUtils"; -import { metadataForms } from "../../support/pages/catalog/metadataComponent"; -import { - fillUpCommonFieldsForAllProductTypes, -} from "../../support/pages/catalog/products/productDetailsPage"; - -describe("Update products", () => { - const startsWith = "CyUpdateProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - const description = faker.lorem.sentences(2); - - let defaultChannel; - let collection; - let product; - let attribute; - - before(() => { - cy.loginUserViaRequest(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - createCollection(name); - }) - .then(collectionResp => { - collection = collectionResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute: attributeResp, category, productType }) => { - attribute = attributeResp; - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - name, - collectionId: collection.id, - description, - }); - }) - .then(({ product: productResp }) => { - product = productResp; - cy.checkIfDataAreNotNull({ - defaultChannel, - collection, - product, - attribute, - }); - }); - }); - - it( - "Should update product. TC: SALEOR_2703", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - const updatedName = `${startsWith}${faker.random.number()}`; - let updatedCategory; - let updatedCollection; - createCategory({ name: updatedName }) - .then(categoryResp => { - updatedCategory = categoryResp; - createCollection(updatedName); - }) - .then(collectionResp => { - updatedCollection = collectionResp; - const productData = { - generalInfo: { - name: updatedName, - description: faker.lorem.sentence(), - rating: 3, - }, - seo: { - slug: updatedName, - title: "newTitle", - description: "New description.", - }, - metadata: { - private: { - metadataForm: metadataForms.private, - name: "newPrivate", - value: "value1", - }, - public: { - metadataForm: metadataForms.public, - name: "newPublic", - value: "value2", - }, - }, - productOrganization: { - category: updatedCategory.name, - collection: updatedCollection.name, - }, - }; - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) - .visit(productDetailsUrl(product.id)) - .get(PRODUCT_DETAILS.collectionRemoveButtons) - .click(); - fillUpCommonFieldsForAllProductTypes(productData, false); - cy.addAliasToGraphRequest("UpdatePrivateMetadata") - .addAliasToGraphRequest("UpdateMetadata") - .addAliasToGraphRequest("ProductUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@ProductUpdate") - .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") - .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); - productData.productOrganization.productType = name; - productData.attribute = attribute; - cy.loginUserViaRequest("token") - .then(() => { - getProductDetails(product.id, defaultChannel.slug, "auth").its( - "body.data.product", - ); - }) - .then(resp => { - expectCorrectProductInformation(resp, productData); - }); - }); - }, - ); - - it( - "should delete product. TC: SALEOR_2704", - { tags: ["@products", "@allEnv", "@stable"] }, - () => { - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) - .visit(productDetailsUrl(product.id)) - .addAliasToGraphRequest("ProductDelete") - .get(BUTTON_SELECTORS.deleteButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductDelete") - .loginUserViaRequest("token") - .then(() => { - getProductDetails(product.id, defaultChannel.slug).its("body.data"); - }) - .then( - productResp => - expect(productResp.product, "Check if product exist").to.be.null, - ); - }, - ); -}); diff --git a/cypress/e2e/staffMembers.js b/cypress/e2e/staffMembers.js deleted file mode 100644 index 9bf35140659..00000000000 --- a/cypress/e2e/staffMembers.js +++ /dev/null @@ -1,292 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - BUTTON_SELECTORS, - HOMEPAGE_SELECTORS, - INVITE_STAFF_MEMBER_FORM_SELECTORS, - SHARED_ELEMENTS, - STAFF_MEMBER_DETAILS_SELECTORS, - STAFF_MEMBERS_LIST_SELECTORS, -} from "../elements/"; -import { LOGIN_SELECTORS } from "../elements/account/login-selectors"; -import { MESSAGES, TEST_ADMIN_USER, urlList } from "../fixtures"; -import { userDetailsUrl } from "../fixtures/urlList"; -import { activatePlugin, updatePlugin } from "../support/api/requests/"; -import { - getMailActivationLinkForUser, - getMailActivationLinkForUserAndSubject, - inviteStaffMemberWithFirstPermission, -} from "../support/api/utils/"; -import { ensureCanvasStatic } from "../support/customCommands/sharedElementsOperations/canvas"; -import { - expectMainMenuAvailableSections, - expectWelcomeMessageIncludes, - fillUpOnlyUserDetails, - fillUpSetPassword, - fillUpUserDetailsAndAddFirstPermission, -} from "../support/pages/"; - -describe("Staff members", () => { - const startsWith = "StaffMembers" + Date.now(); - const password = Cypress.env("USER_PASSWORD"); - const lastName = faker.name.lastName(); - const email = `${startsWith}${lastName}@example.com`; - - let user; - - before(() => { - cy.loginUserViaRequest(); - activatePlugin({ id: "mirumee.notifications.admin_email" }); - inviteStaffMemberWithFirstPermission({ email }) - .then(({ user: userResp }) => { - user = userResp; - getMailActivationLinkForUser(email); - }) - .then(urlLink => { - cy.clearSessionData().visit(urlLink); - fillUpSetPassword(password); - cy.clearSessionData(); - cy.checkIfDataAreNotNull({ user }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to invite staff user. TC: SALEOR_3501", - { tags: ["@staffMembers", "@allEnv", "@critical"] }, - () => { - const firstName = faker.name.firstName(); - const emailInvite = `${startsWith}${firstName}@example.com`; - - cy.visit(urlList.staffMembers); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.get(STAFF_MEMBERS_LIST_SELECTORS.inviteStaffMemberButton).click({ - force: true, - }); - fillUpUserDetailsAndAddFirstPermission(firstName, lastName, emailInvite); - getMailActivationLinkForUser(emailInvite).then(urlLink => { - cy.clearSessionData().visit(urlLink); - fillUpSetPassword(password); - expectWelcomeMessageIncludes(`${firstName} ${lastName}`); - }); - }, - ); - - it( - "should remove user permissions. TC: SALEOR_3504", - { tags: ["@staffMembers", "@allEnv"] }, - () => { - const serverStoredEmail = email.toLowerCase(); - - cy.visit(userDetailsUrl(user.id)) - .get(STAFF_MEMBER_DETAILS_SELECTORS.removePermissionButton) - .click() - .addAliasToGraphRequest("StaffMemberUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@StaffMemberUpdate") - .clearSessionData() - .loginUserViaRequest("auth", { email, password }) - .visit(urlList.homePage); - expectWelcomeMessageIncludes(serverStoredEmail); - expectMainMenuAvailableSections(1); - cy.get(HOMEPAGE_SELECTORS.activity).should("not.exist"); - cy.get(HOMEPAGE_SELECTORS.topProducts).should("not.exist"); - }, - ); - - it( - "should reset password. TC: SALEOR_3505", - { tags: ["@staffMembers", "@allEnv", "@critical"] }, - () => { - const newPassword = faker.random.alphaNumeric(8); - updatePlugin( - "mirumee.notifications.admin_email", - "staff_password_reset_subject", - "Reset", - ) - .then(() => { - cy.clearSessionData() - .visit(urlList.homePage) - .get(LOGIN_SELECTORS.resetPasswordLink) - .click() - .get(LOGIN_SELECTORS.emailAddressInput) - .type(email) - .get(BUTTON_SELECTORS.submit) - .click(); - getMailActivationLinkForUserAndSubject(email, "Reset"); - }) - .then(link => { - cy.visit(link) - .get(LOGIN_SELECTORS.emailPasswordInput) - .type(newPassword) - .get(LOGIN_SELECTORS.confirmPassword) - .type(newPassword) - .get(BUTTON_SELECTORS.confirm) - .click() - .get(LOGIN_SELECTORS.welcomePage) - .should("be.visible") - .loginUserViaRequest({ email, password: newPassword }); - }); - }, - ); - - it( - "should not be able to create staff member with not unique email. TC: SALEOR_3508 - should not be migrated to playwright as critical", - { tags: ["@staffMembers", "@allEnv", "@critical"] }, - () => { - const firstName = faker.name.firstName(); - const emailInvite = TEST_ADMIN_USER.email; - cy.visit(urlList.staffMembers); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.get(STAFF_MEMBERS_LIST_SELECTORS.inviteStaffMemberButton).click({ - force: true, - }); - fillUpOnlyUserDetails(firstName, lastName, emailInvite); - cy.get(INVITE_STAFF_MEMBER_FORM_SELECTORS.emailValidationMessage).should( - "be.visible", - ); - cy.get(BUTTON_SELECTORS.dialogBackButton).click(); - cy.confirmationErrorMessageShouldAppear(); - }, - ); - - it( - "should not be able to update staff member with not unique email. TC: SALEOR_3509", - { tags: ["@staffMembers", "@allEnv"] }, - () => { - cy.addAliasToGraphRequest("StaffList"); - cy.visit(urlList.staffMembers) - .waitForRequestAndCheckIfNoErrors("@StaffList") - .get(SHARED_ELEMENTS.searchInput) - .type(`${email} {enter}`) - .waitForRequestAndCheckIfNoErrors("@StaffList"); - cy.get(SHARED_ELEMENTS.dataGridTable) - .contains(email.toLowerCase()) - .should("exist"); - // selects first row - cy.clickGridCell(0, 0); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.staffEmail) - .click() - .clear() - .type(`${TEST_ADMIN_USER.email} {enter}`) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationErrorMessageShouldAppear(); - cy.contains(MESSAGES.invalidEmailAddress).should("be.visible"); - }, - ); - - // Test blocked by https://github.com/saleor/saleor-dashboard/issues/2847 - it.skip( - "should update staff member name and email. TC: SALEOR_3507", - { tags: ["@staffMembers", "@allEnv"] }, - () => { - const newLastName = faker.name.lastName(); - const newEmail = `${startsWith}${newLastName}@example.com`; - const changedName = faker.name.lastName(); - const changedEmail = `${startsWith}${changedName}@example.com`; - - inviteStaffMemberWithFirstPermission({ email: newEmail }) - .then(({ user: userResp }) => { - user = userResp; - getMailActivationLinkForUser(newEmail); - }) - .then(urlLink => { - cy.clearSessionData().visit(urlLink); - fillUpSetPassword(password); - cy.clearSessionData(); - }); - - cy.clearSessionData().loginUserViaRequest("auth", { - email: newEmail, - password: Cypress.env("USER_PASSWORD"), - }); - - cy.visit(urlList.staffMembers).get(LOGIN_SELECTORS.userMenu).click(); - cy.get(LOGIN_SELECTORS.accountSettings).click(); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.staffFirstName) - .clear() - .type("สมชาย"); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.staffLastName) - .clear() - .type(newLastName); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.staffEmail) - .clear() - .type(changedEmail); - - // Test blocked from this point by https://github.com/saleor/saleor-dashboard/issues/2847 - cy.get(BUTTON_SELECTORS.confirm).confirmationMessageShouldAppear(); - cy.clearSessionData().loginUserViaRequest("auth", { - email: changedEmail, - password: Cypress.env("USER_PASSWORD"), - }); - - cy.visit(urlList.staffMembers); - expectWelcomeMessageIncludes(`${changedName}`); - }, - ); - - it( - "should create new user and successfully change password. TC: SALEOR_3510", - { tags: ["@staffMembers", "@allEnv", "@critical"] }, - () => { - const newPass = "newTestPass"; - const newLastName = faker.name.lastName(); - const newEmail = `${startsWith}${newLastName}@example.com`; - - inviteStaffMemberWithFirstPermission({ email: newEmail }) - .then(({ user: userResp }) => { - user = userResp; - getMailActivationLinkForUser(newEmail); - }) - .then(urlLink => { - cy.clearSessionData().visit(urlLink); - fillUpSetPassword(password); - cy.clearSessionData(); - }); - - cy.clearSessionData().loginUserViaRequest("auth", { - email: newEmail, - password: Cypress.env("USER_PASSWORD"), - }); - - cy.visit(urlList.staffMembers).get(LOGIN_SELECTORS.userMenu).click(); - cy.get(LOGIN_SELECTORS.accountSettings).click(); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.changePasswordBtn).should( - "be.visible", - ); - // there is small bug which keep control panel opens and block any interaction via cypress - it does not affect real user - click on body can be removed when this pr is done https://github.com/saleor/saleor-dashboard/issues/3675 - cy.get(SHARED_ELEMENTS.body).click({ force: true }); - cy.get(STAFF_MEMBER_DETAILS_SELECTORS.changePasswordBtn).click(); - cy.get( - STAFF_MEMBER_DETAILS_SELECTORS.changePasswordModal.oldPassword, - ).type(Cypress.env("USER_PASSWORD")); - cy.get( - STAFF_MEMBER_DETAILS_SELECTORS.changePasswordModal.newPassword, - ).type(newPass); - cy.addAliasToGraphRequest("ChangeUserPassword") - .get(BUTTON_SELECTORS.submit) - .click() - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors("@ChangeUserPassword"); - - cy.clearSessionData().loginUserViaRequest("auth", { - email: newEmail, - password: newPass, - }); - cy.visit(urlList.homePage) - .get(HOMEPAGE_SELECTORS.welcomeMessage) - .should("be.visible"); - cy.get(HOMEPAGE_SELECTORS.activity).should("be.visible"); - cy.get(HOMEPAGE_SELECTORS.topProducts).should("be.visible"); - }, - ); -}); diff --git a/cypress/e2e/translations.js b/cypress/e2e/translations.js deleted file mode 100644 index 418ca99f945..00000000000 --- a/cypress/e2e/translations.js +++ /dev/null @@ -1,93 +0,0 @@ -/// -/// - -import faker from "faker"; - -import { - createCategory, - getCategory, - updateCategoryTranslation, -} from "../support/api/requests/Category"; -import { updateTranslationToCategory } from "../support/pages/translationsPage"; - -describe("As an admin I want to manage translations", () => { - const startsWith = "TestTranslations - " + Date.now(); - const randomNumber = faker.datatype.number(); - const slug = `${faker.lorem.slug()}slug`; - - let category; - - before(() => { - cy.loginUserViaRequest(); - createCategory({ name: startsWith, slug }).then(categoryResp => { - category = categoryResp; - cy.checkIfDataAreNotNull({ category }); - }); - }); - - beforeEach(() => { - cy.loginUserViaRequest(); - }); - - it( - "should be able to create new translation. TC:SALEOR_1701", - { tags: ["@translations", "@allEnv", "@stable"] }, - () => { - const translatedName = `TranslatedName${randomNumber}`; - const translatedDescription = `TranslatedDescription${randomNumber}`; - const translatedSeoTitle = `TranslatedSeoTitle${randomNumber}`; - const translatedSeoDescription = `TranslatedSeoDescription${randomNumber}`; - - updateTranslationToCategory({ - categoryName: category.name, - translatedName, - translatedDescription, - translatedSeoTitle, - translatedSeoDescription, - }); - getCategory(category.id, "PL") - .its("translation") - .should("include", { name: `${translatedName}` }) - .and("include", { seoDescription: `${translatedSeoDescription}` }) - .and("include", { seoTitle: `${translatedSeoTitle}` }) - .its("description") - .should("have.string", `{"text": "${translatedDescription}"}`); - }, - ); - - it( - "should be able to update translation. TC:SALEOR_1702", - { tags: ["@translations", "@allEnv", "@stable"] }, - () => { - const startWithUpdate = `Translations_Update_${randomNumber}`; - const seoTitleUpdate = `${startWithUpdate}_seoTitle`; - const seoDescriptionUpdate = `${startWithUpdate}_seoDescription`; - const nameUpdate = `${startWithUpdate}_nameUpdate`; - const descriptionUpdate = `${startWithUpdate}_descryptionUpdate`; - - updateCategoryTranslation({ - categoryTranslateId: category.id, - languageCode: "PL", - seoTitle: "test", - seoDescription: "test", - name: "test", - description: "test", - }).then(() => { - updateTranslationToCategory({ - categoryName: category.name, - translatedName: nameUpdate, - translatedDescription: descriptionUpdate, - translatedSeoTitle: seoTitleUpdate, - translatedSeoDescription: seoDescriptionUpdate, - }); - getCategory(category.id, "PL") - .its("translation") - .should("include", { name: `${nameUpdate}` }) - .and("include", { seoDescription: `${seoDescriptionUpdate}` }) - .and("include", { seoTitle: `${seoTitleUpdate}` }) - .its("description") - .should("have.string", `{"text": "${descriptionUpdate}"}`); - }); - }, - ); -}); diff --git a/cypress/elements/account/index.js b/cypress/elements/account/index.js deleted file mode 100644 index 383902adb9d..00000000000 --- a/cypress/elements/account/index.js +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable import/no-duplicates */ -import * as MENU_SELECTORS from "./left-menu/left-menu-selectors"; -import * as LOGIN_SELECTORS from "./login-selectors"; -import * as SET_PASSWORD_SELECTORS from "./login-selectors"; - -export { MENU_SELECTORS, LOGIN_SELECTORS, SET_PASSWORD_SELECTORS }; diff --git a/cypress/elements/account/left-menu/left-menu-selectors.js b/cypress/elements/account/left-menu/left-menu-selectors.js deleted file mode 100644 index 23d44c7d1a0..00000000000 --- a/cypress/elements/account/left-menu/left-menu-selectors.js +++ /dev/null @@ -1,36 +0,0 @@ -export const MENU = { - catalog: "[data-test-id='menu-item-label-catalogue']", - pages: "[data-test-id='menu-item-label-pages']", - configuration: "[data-test-id='menu-item-label-configure']", - home: "[data-test-id='menu-item-label-home']", - orders: "[data-test-id='menu-item-label-orders']", - discounts: "[data-test-id='menu-item-label-discounts']", - appSection: "[data-test-id='menu-item-label-apps_section']", - app: "[data-test-id='menu-item-label-apps']", - translations: "[data-test-id='menu-item-label-translations']", - customers: "[data-test-id='menu-item-label-customers']", - list: "[data-test-id='menu-list']", - listItem: "[data-test-id='menu-list-item']", - products: "[data-test-id='menu-item-label-products']", - menuItem: "[data-test-id*='menu-item-label-']", -}; -export const DISCOUNTS = { - sales: "[data-test-id='menu-item-label-sales']", - vouchers: "[data-test-id='menu-item-label-vouchers']", -}; -export const ORDERS = { - orders: "[data-test-id='menu-item-label-orders']", - draftOrders: "[data-test-id='menu-item-label-order-drafts']", -}; -export const CATALOG = { - products: "[data-test-id='menu-item-label-products']", - categories: "[data-test-id='menu-item-label-categories']", - collections: "[data-test-id='menu-item-label-collections']", - giftCards: "[data-test-id='menu-item-label-giftCards']", -}; - -export const APP = { - app: "[data-test-id='menu-item-label-apps']", -}; - -export const appCommonSelector = "[data-test-id*='apps']"; diff --git a/cypress/elements/account/login-selectors.js b/cypress/elements/account/login-selectors.js deleted file mode 100644 index a05eadf1336..00000000000 --- a/cypress/elements/account/login-selectors.js +++ /dev/null @@ -1,12 +0,0 @@ -export const LOGIN_SELECTORS = { - accountSettings: "[data-test-id=account-settings-button]", - emailAddressInput: "input[name='email']", - emailPasswordInput: "input[name='password']", - signInButton: "[data-test-id=submit]", - userMenu: "[data-test-id=userMenu]", - warningCredentialMessage: "[data-test-id=login-error-message]", - welcomePage: "[data-test-id=welcome-header]", - logOutButton: "[data-test-id='log-out-button']", - resetPasswordLink: "[data-test-id='reset-password-link']", - confirmPassword: "[name='confirmPassword']", -}; diff --git a/cypress/elements/account/setPassword.js b/cypress/elements/account/setPassword.js deleted file mode 100644 index b3643a289d7..00000000000 --- a/cypress/elements/account/setPassword.js +++ /dev/null @@ -1,4 +0,0 @@ -export const SET_PASSWORD = { - passwordInput: '[data-test-id="password"]', - confirmPasswordInput: '[data-test-id="confirm-password"]' -}; diff --git a/cypress/elements/apps/appDetails.js b/cypress/elements/apps/appDetails.js deleted file mode 100644 index 787bb200a11..00000000000 --- a/cypress/elements/apps/appDetails.js +++ /dev/null @@ -1,12 +0,0 @@ -export const APP_DETAILS = { - nameInput: '[name="name"]', - manageAppsPermissionCheckbox: '[id="MANAGE_APPS"]', - createWebhookButton: '[data-test-id = "create-webhook"]', - createTokenButton: '[data-test-id="create-token"]', - createTokenForm: { - tokenDialog: '[role="dialog"]', - nameInput: '[name="name"]', - tokenToCopy: '[data-test-id="generated-token"]', - doneButton: '[data-test-id="done"]', - }, -}; diff --git a/cypress/elements/apps/appsList.js b/cypress/elements/apps/appsList.js deleted file mode 100644 index 65fbc08eb8b..00000000000 --- a/cypress/elements/apps/appsList.js +++ /dev/null @@ -1,4 +0,0 @@ -export const APPS_LIST_SELECTORS = { - createLocalAppButton: '[data-test-id="create-app"]', - createExternalAppButton: '[data-test-id="add-app-from-manifest"]', -}; diff --git a/cypress/elements/apps/index.js b/cypress/elements/apps/index.js deleted file mode 100644 index 69b1855d74c..00000000000 --- a/cypress/elements/apps/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { APPS_LIST_SELECTORS } from "./appsList"; - -export { APPS_LIST_SELECTORS }; diff --git a/cypress/elements/apps/webhookDetails.js b/cypress/elements/apps/webhookDetails.js deleted file mode 100644 index cbfadc437fd..00000000000 --- a/cypress/elements/apps/webhookDetails.js +++ /dev/null @@ -1,6 +0,0 @@ -export const WEBHOOK_DETAILS = { - nameInput: '[name="name"]', - targetUrlInput: '[name="targetUrl"]', - webhookObjects: '[data-test-id="webhook-objects-items"]', - webhookEventsCheckboxes: '[data-test-id="events-checkbox"]', -}; diff --git a/cypress/elements/attribute/attributes_details.js b/cypress/elements/attribute/attributes_details.js deleted file mode 100644 index 3327a128666..00000000000 --- a/cypress/elements/attribute/attributes_details.js +++ /dev/null @@ -1,49 +0,0 @@ -export const ATTRIBUTES_DETAILS = { - nameInput: '[name="name"]', - codeInput: '[name="slug"]', - inputTypeSelect: '[id="mui-component-select-inputType"]', - assignValuesButton: '[data-test-id="assign-value-button"]', - valueRequired: '[name="valueRequired"]', - valueNameInput: '[data-test-id="value-name"]', - dashboardProperties: { - useInFilteringCheckbox: '[name="filterableInDashboard"]', - }, - attributesInputTypes: { - DROPDOWN: '[data-test-id="select-field-option-DROPDOWN"]', - DATE: '[data-test-id="select-field-option-DATE"]', - DATE_TIME: '[data-test-id="select-field-option-DATE_TIME"]', - MULTISELECT: '[data-test-id="select-field-option-MULTISELECT"]', - FILE: '[data-test-id="select-field-option-FILE"]', - REFERENCE: '[data-test-id="select-field-option-REFERENCE"]', - RICH_TEXT: '[data-test-id="select-field-option-RICH_TEXT"]', - NUMERIC: '[data-test-id="select-field-option-NUMERIC"]', - BOOLEAN: '[data-test-id="select-field-option-BOOLEAN"]', - SWATCH: '[data-test-id="select-field-option-SWATCH"]', - }, - entityTypeSelect: '[id="mui-component-select-entityType"]', - entityTypeOptions: { - PRODUCT: '[data-test-id="select-field-option-PRODUCT"]', - PRODUCT_VARIANT: '[data-test-id="select-field-option-PRODUCT_VARIANT"]', - PAGE: '[data-test-id="select-field-option-PAGE"]', - }, - selectUnitCheckbox: '[name="selectUnit"]', - unitSystemSelect: '[data-test-id="unit-system"]', - unitSystemsOptions: { - IMPERIAL: '[data-test-id="select-field-option-imperial"]', - METRIC: '[data-test-id="select-field-option-metric"]', - }, - unitOfSelect: '[data-test-id="unit-of"]', - unitsOfOptions: { - VOLUME: '[data-test-id="select-field-option-volume"]', - DISTANCE: '[data-test-id="select-field-option-distance"]', - }, - unitSelect: '[data-test-id="unit"]', - unitsOptions: { - CUBIC_CENTIMETER: '[data-test-id="select-field-option-CUBIC_CENTIMETER"]', - FT: '[data-test-id="select-field-option-FT"]', - }, - imageCheckbox: '[value= "image"]', - uploadFileButton: '[data-test-id="button-upload-file"]', - pageTypeAttributeCheckbox: '[value="PAGE_TYPE"]', - swatchValueImage: '[data-test-id="swatch-image"]', -}; diff --git a/cypress/elements/attribute/attributes_list.js b/cypress/elements/attribute/attributes_list.js deleted file mode 100644 index 8c905b611a2..00000000000 --- a/cypress/elements/attribute/attributes_list.js +++ /dev/null @@ -1,3 +0,0 @@ -export const ATTRIBUTES_LIST = { - createAttributeButton: '[data-test-id="create-attribute-button"]' -}; diff --git a/cypress/elements/attribute/index.js b/cypress/elements/attribute/index.js deleted file mode 100644 index ce5785c7ded..00000000000 --- a/cypress/elements/attribute/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { ATTRIBUTES_DETAILS } from "./attributes_details"; -import { ATTRIBUTES_LIST } from "./attributes_list"; - -export { ATTRIBUTES_DETAILS, ATTRIBUTES_LIST }; diff --git a/cypress/elements/catalog/categories/categories-list.js b/cypress/elements/catalog/categories/categories-list.js deleted file mode 100644 index 46551ca09a5..00000000000 --- a/cypress/elements/catalog/categories/categories-list.js +++ /dev/null @@ -1,5 +0,0 @@ -export const CATEGORIES_LIST_SELECTORS = { - addCategoryButton: '[data-test-id="create-category"]', -}; - -export const categoryRow = categoryId => `[data-test-id*="${categoryId}"]`; diff --git a/cypress/elements/catalog/categories/category-details.js b/cypress/elements/catalog/categories/category-details.js deleted file mode 100644 index 0efefd9ffa8..00000000000 --- a/cypress/elements/catalog/categories/category-details.js +++ /dev/null @@ -1,10 +0,0 @@ -export const CATEGORY_DETAILS_SELECTORS = { - nameInput: '[name="name"]', - descriptionInput: '[data-test-id="rich-text-editor-description"]', - createSubcategoryButton: '[data-test-id="create-subcategory"]', - categoryChildrenRow: "[data-test-id^='id-']", - productsTab: '[data-test-id="products-tab"]', - addProducts: '[data-test-id="add-products"]', - productRow: '[data-test-id="product-row"]', - deleteCategoriesButton: '[data-test-id="bulk-delete-button"]', -}; diff --git a/cypress/elements/catalog/categories/index.js b/cypress/elements/catalog/categories/index.js deleted file mode 100644 index 76a253bced4..00000000000 --- a/cypress/elements/catalog/categories/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { CATEGORIES_LIST_SELECTORS } from "./categories-list"; -import { CATEGORY_DETAILS_SELECTORS } from "./category-details"; - -export { CATEGORIES_LIST_SELECTORS, CATEGORY_DETAILS_SELECTORS }; diff --git a/cypress/elements/catalog/collection-selectors.js b/cypress/elements/catalog/collection-selectors.js deleted file mode 100644 index 723c7594fb8..00000000000 --- a/cypress/elements/catalog/collection-selectors.js +++ /dev/null @@ -1,12 +0,0 @@ -export const COLLECTION_SELECTORS = { - createCollectionButton: "[data-test-id = 'create-collection']", - nameInput: "[name='name']", - saveButton: "[data-test-id='button-bar-confirm']", - addProductButton: "[data-test-id='add-product']", - descriptionInput: '[data-test-id="rich-text-editor-description"]', - placeholder: "[data-placeholder]", -}; - -export const collectionRow = collectionId => - `[data-test-id*="${collectionId}"]`; -export const productRow = productId => `[data-test-id*="${productId}"]`; diff --git a/cypress/elements/catalog/giftCard/giftCardDialog.js b/cypress/elements/catalog/giftCard/giftCardDialog.js deleted file mode 100644 index d7fc90cfe95..00000000000 --- a/cypress/elements/catalog/giftCard/giftCardDialog.js +++ /dev/null @@ -1,18 +0,0 @@ -export const GIFT_CARD_DIALOG = { - amountInput: '[name="balanceAmount"]', - currencySelectButton: '[id="mui-component-select-balanceCurrency"]', - currenciesOptions: '[data-test-id*="select-field-option"]', - expirationOptions: { - setExpiryDateCheckbox: '[name="expirySelected"]', - neverExpireRadioButton: '[value="NEVER_EXPIRE"]', - expiryPeriodRadioButton: '[value="EXPIRY_PERIOD"]', - expiryDateRadioButton: '[value="EXPIRY_DATE"]', - expiryPeriodAmount: '[name="expiryPeriodAmount"]', - expiryPeriodTypeButton: '[id*="select-expiryPeriodType"]', - expiryPeriodMonthType: '[data-test-id="select-field-option-MONTH"]', - expiryDateInput: '[name="expiryDate"]' - }, - noteInput: '[name="note"]', - cardCodeText: '[data-test-id="card-code"]', - tagInput: '[data-test-id="gift-card-tag-select-field"]' -}; diff --git a/cypress/elements/catalog/giftCard/giftCardList.js b/cypress/elements/catalog/giftCard/giftCardList.js deleted file mode 100644 index 4519535ea73..00000000000 --- a/cypress/elements/catalog/giftCard/giftCardList.js +++ /dev/null @@ -1,10 +0,0 @@ -export const GIFT_CARD_LIST = { - issueCardButton: '[data-test-id="issue-card-button"]', - selectGiftCardCheckbox: '[data-test-id="select-gift-card-checkbox"]', - deactivateGiftCardButton: '[data-test-id="deactivate-gift-cards"]', - activateGiftCardButton: '[data-test-id="activate-gift-cards"]', - selectedAmount: '[data-test-id="SelectedText"]', -}; - -export const giftCardRow = giftCardId => - `[data-test-id="gift-card-row-${giftCardId}"]`; diff --git a/cypress/elements/catalog/giftCard/giftCardShowMore.js b/cypress/elements/catalog/giftCard/giftCardShowMore.js deleted file mode 100644 index 519f881103a..00000000000 --- a/cypress/elements/catalog/giftCard/giftCardShowMore.js +++ /dev/null @@ -1,10 +0,0 @@ -export const GIFT_CARD_SHOW_MORE = { - settingsMenu: '[data-test-id="settingsMenuItem"]', - bulkIssueMenu: '[data-test-id="bulkIssueMenuItem"]', - exportCodesMenu: '[data-test-id="exportCodesMenuItem"]', - exportAsRadioBtn: { - csv: 'input[value="CSV"]', - xlsx: 'input[value="XLSX"]', - }, - exportSelectedRecords: '[data-test-id="IDS"]', -}; diff --git a/cypress/elements/catalog/giftCard/giftCardUpdate.js b/cypress/elements/catalog/giftCard/giftCardUpdate.js deleted file mode 100644 index 6b02be0310b..00000000000 --- a/cypress/elements/catalog/giftCard/giftCardUpdate.js +++ /dev/null @@ -1,10 +0,0 @@ -export const GIFT_CARD_UPDATE = { - changeActiveStatusButton: '[data-test-id="enable-button"]', - consentCheckbox: '[name="delete-assigned-items-consent"]', - giftCardTagSelect: '[data-test-id="gift-card-tag-select-field"]', - expireCheckbox: '[name="cardExpires"]', - expireDateInput: '[name="expiryDate"]', - autocompleteCustomOption: - '[data-test-id="multi-autocomplete-select-option-custom"]', - removeTagButton: '[data-test-id="remove"]', -}; diff --git a/cypress/elements/catalog/index.js b/cypress/elements/catalog/index.js deleted file mode 100644 index 9d6e1e082d5..00000000000 --- a/cypress/elements/catalog/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import { - CATEGORIES_LIST_SELECTORS, - CATEGORY_DETAILS_SELECTORS, -} from "./categories"; -import { COLLECTION_SELECTORS } from "./collection-selectors"; -import { PRODUCT_DETAILS, PRODUCTS_LIST } from "./products"; - -export { - CATEGORIES_LIST_SELECTORS, - CATEGORY_DETAILS_SELECTORS, - COLLECTION_SELECTORS, - PRODUCT_DETAILS, - PRODUCTS_LIST, -}; diff --git a/cypress/elements/catalog/products/assign-products.js b/cypress/elements/catalog/products/assign-products.js deleted file mode 100644 index de21cb96b5b..00000000000 --- a/cypress/elements/catalog/products/assign-products.js +++ /dev/null @@ -1,4 +0,0 @@ -export const ASSIGN_PRODUCTS_SELECTORS = { - searchInput: "[name='query']", - tableRow: "[data-test-id='assign-product-table-row']" -}; diff --git a/cypress/elements/catalog/products/index.js b/cypress/elements/catalog/products/index.js deleted file mode 100644 index ef7ef68345a..00000000000 --- a/cypress/elements/catalog/products/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { PRODUCT_DETAILS } from "./product-details"; -export { PRODUCTS_LIST } from "./products-list"; diff --git a/cypress/elements/catalog/products/price-list.js b/cypress/elements/catalog/products/price-list.js deleted file mode 100644 index 6b5f425cdfe..00000000000 --- a/cypress/elements/catalog/products/price-list.js +++ /dev/null @@ -1,4 +0,0 @@ -export const PRICE_LIST = { - priceInput: "[name*='channel-price']", - costPriceInput: "[name*='channel-costPrice']" -}; diff --git a/cypress/elements/catalog/products/product-details.js b/cypress/elements/catalog/products/product-details.js deleted file mode 100644 index 7462491771e..00000000000 --- a/cypress/elements/catalog/products/product-details.js +++ /dev/null @@ -1,32 +0,0 @@ -export const PRODUCT_DETAILS = { - productNameInput: "[name='name']", - productTypeInput: "[data-test-id='product-type']", - categoryInput: "[data-test-id='category']", - categoryItem: "[data-test-id='single-autocomplete-select-option']", - collectionInput: "[data-test-id='collections']", - autocompleteDropdown: "[data-test-id='autocomplete-dropdown']", - firstCategoryItem: "#downshift-0-item-0", - visibleRadioBtn: "[name='isPublished']", - channelAvailabilityItem: "[data-test-id*='channel-availability-item']", - addVariantButton: "[data-test-id*='button-add-variant']", - descriptionInput: "[data-test-id='rich-text-editor-description']", - ratingInput: "[name='rating']", - skuInput: "[name='sku']", - variantRow: "[data-test-id='product-variant-row']", - variantPrice: '[data-test-id="price"]', - collectionRemoveButtons: '[data-test-id*="selected-option"] span:last-child', - addWarehouseButton: '[data-test-id="add-warehouse"]', - warehouseOption: "[role='menuitem']", - stockInput: '[data-test-id="stock-input"]', - costPriceInput: '[name*="costPrice"]', - sellingPriceInput: '[name*="channel-price"]', - productImage: '[data-test-id="product-image"]', - uploadImageButton: '[data-test-id="button-upload-image"]', - uploadSavedImagesButton: '[data-test-id="upload-images"]', - uploadMediaUrlButton: '[data-test-id="upload-media-url"]', - saveUploadUrlButton: '[data-test-id="upload-url-button"]', - editVariant: '[data-test-id="row-action-button"]', - firstRowDataGrid: "[data-testid='glide-cell-1-0']", - dataGridTable: "[data-testid='data-grid-canvas']", - productUpdateFormSection: "[data-test-id='product-update-form']", -}; diff --git a/cypress/elements/catalog/products/products-list.js b/cypress/elements/catalog/products/products-list.js deleted file mode 100644 index 37b34b4bb3e..00000000000 --- a/cypress/elements/catalog/products/products-list.js +++ /dev/null @@ -1,64 +0,0 @@ -export const PRODUCTS_LIST = { - newFilters: { - saveFiltersButton: "[data-test-id='save-filters-button']", - rightInput: "[data-test-id='right-0']", - dropDownOptions: "[data-test-id='select-option']", - leftInput: "[data-test-id='left-0']", - showFiltersButton: "[data-test-id='filters-button']", - addFilterButton: "[data-test-id='add-filter-button']", - }, - productsList: "[data-test-id^='id-']", - dataGridTable: "[data-testid='data-grid-canvas']", - productsNames: "[data-test-id='name']", - dialogProductTypeInput: "[data-test-id='dialog-product-type']", - createProductBtn: "[data-test-id='add-product']", - searchProducts: "[placeholder='Search Products...']", - emptyProductRow: "[data-test-id='skeleton']", - productImage: "[class='MuiAvatar-img']", - imageIcon: '[data-test-id="imageIcon"]', - tableCellAvatar: "[data-test-id='table-cell-avatar']", - productRowElements: { - name: '[data-test-id="name"]', - type: '[data-test-id="product-type"]', - availability: '[data-test-id="availability"]', - price: '[data-test-id="price"]', - }, - tableHeaders: { - name: "[data-test-id='col-name-header']", - type: "[data-test-id='col-type-header']", - availability: "[data-test-id='col-availability-header']", - price: "[data-test-id='col-price-header']", - }, - showFiltersButton: '[data-test-id="show-filters-button"]', - filters: { - filterOption: '[data-test-id="filter-option"]', - productsOutOfStockOption: '[data-test-id="filter-option-OUT_OF_STOCK"]', - filterBy: { - category: '[data-test-id="filter-group-active-categories"]', - collection: '[data-test-id="filter-group-active-collections"]', - productType: '[data-test-id="filter-group-active-productType"]', - stock: '[data-test-id="filter-group-active-stock"]', - channel: '[data-test-id="filter-group-active-channel"]', - currency: '[data-test-id="filter-group-active-currency"]', - currencySpecific: { - THB: '[data-test-id="filter-option-THB"]', - PLN: '[data-test-id="filter-option-PLN"]', - USD: '[data-test-id="filter-option-USD"]', - }, - }, - filterField: { - filterField: '[data-test-id*="filter-field"]', - category: '[data-test-id="filter-field-categories"]', - collection: '[data-test-id="filter-field-collections"]', - productType: '[data-test-id="filter-field-productType"]', - stock: '[data-test-id="filter-field-stock"]', - channel: '[data-test-id="filter-field-channel"]', - }, - filterBySearchInput: '[data-test-id="filter-field-autocomplete-input"]', - }, - resultsOnPageSelect: "[data-test-id='PaginationRowNumberSelect']", - rowNumberOption: "[data-test-id='rowNumberOption']", - tileViewButton: '[data-test-id="tile-view-button"]', - datagridViewButton: '[data-test-id="datagrid-view-button"]', - tileProductsView: '[data-test-id="tile-view"]', -}; diff --git a/cypress/elements/catalog/products/variants-selectors.js b/cypress/elements/catalog/products/variants-selectors.js deleted file mode 100644 index 1b66a40863c..00000000000 --- a/cypress/elements/catalog/products/variants-selectors.js +++ /dev/null @@ -1,14 +0,0 @@ -export const VARIANTS_SELECTORS = { - variantNameInput: '[data-test-id="variant-name-input"]', - skuTextField: '[data-test-id="sku"]', - attributeOption: "[data-test-id='select-option']", - attributeSelector: "[data-test-id='attribute-value']", - addWarehouseButton: "[data-test-id='add-warehouse']", - warehouseOption: "[role='menuitem']", - saveButton: "[data-test-id='button-bar-confirm']", - stockInput: "[data-test-id='stock-input']", - booleanAttributeCheckbox: "[name*='attribute'][type='checkbox']", - selectOption: "[data-test-id='multi-autocomplete-select-option']", - manageChannels: "[data-test-id='manage-channels-button']", - allChannels: "[name='allChannels']", -}; diff --git a/cypress/elements/channels/add-channel-form-selectors.js b/cypress/elements/channels/add-channel-form-selectors.js deleted file mode 100644 index 233b5cd0acc..00000000000 --- a/cypress/elements/channels/add-channel-form-selectors.js +++ /dev/null @@ -1,19 +0,0 @@ -export const ADD_CHANNEL_FORM_SELECTORS = { - channelName: "[name='name']", - slug: "[name='slug']", - currency: "[data-test-id='channel-currency-select-input']", - currencyOptions: "[data-test-id='single-autocomplete-select-option']", - saveButton: "[data-test-id='button-bar-confirm']", - backToChannelsList: "[data-test-id='app-header-back-button']", - currencyValidationMessage: "[data-test-id='currency-text-input-helper-text']", - slugValidationMessage: "[data-test-id='slug-text-input-helper-text']", - currencyAutocompleteDropdown: - "[data-test-id='single-autocomplete-select-option'][data-test-type='custom']", - addShippingZoneButton: '[data-test-id="shipping-add-button"]', - addWarehouseButton: '[data-test-id="warehouse-add-button"]', - shippingAutocompleteSelect: "[data-test-id='shipping-auto-complete-select']", - warehouseAutocompleteSelect: - "[data-test-id='warehouse-auto-complete-select']", - countryAutocompleteInput: '[data-test-id="country-select-input"]', - generalInformationSection: '[data-test-id="general-information"]', -}; diff --git a/cypress/elements/channels/available-channels-form.js b/cypress/elements/channels/available-channels-form.js deleted file mode 100644 index c49014412bc..00000000000 --- a/cypress/elements/channels/available-channels-form.js +++ /dev/null @@ -1,10 +0,0 @@ -export const AVAILABLE_CHANNELS_FORM = { - manageChannelsButton: "[data-test-id='channels-availability-manage-button']", - assignedChannels: "[data-test-id='channel-availability-item']", - publishedRadioButtons: "[name*='isPublished'] > ", - availableForPurchaseRadioButtons: "[id*='isAvailableForPurchase']", - radioButtonsValueTrue: "[value='true']", - radioButtonsValueFalse: "[value='false']", - visibleInListingsButton: "[id*='visibleInListings']", - availableChannel: "[data-test-id*='channel-availability-item']", -}; diff --git a/cypress/elements/channels/channel-form-selectors.js b/cypress/elements/channels/channel-form-selectors.js deleted file mode 100644 index fa77cd4942b..00000000000 --- a/cypress/elements/channels/channel-form-selectors.js +++ /dev/null @@ -1,5 +0,0 @@ -export const CHANNEL_FORM_SELECTORS = { - channelSelect: "[data-test-id='channel-autocomplete']", - channelOption: "[data-test-id*='select-field-option']", - confirmButton: "[data-test-id='submit']" -}; diff --git a/cypress/elements/channels/channels-selectors.js b/cypress/elements/channels/channels-selectors.js deleted file mode 100644 index c249fdf18f2..00000000000 --- a/cypress/elements/channels/channels-selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -export const CHANNELS_SELECTORS = { - createChannelButton: "[data-test-id='add-channel']", - channelsTable: "[class='MuiTableBody-root']", - channelName: "[data-test-id='name']", - orderExpirationInput: "[data-test-id='delete-expired-order-input']", -}; diff --git a/cypress/elements/channels/index.js b/cypress/elements/channels/index.js deleted file mode 100644 index a556c2fc929..00000000000 --- a/cypress/elements/channels/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { CHANNEL_FORM_SELECTORS } from "./channel-form-selectors"; -import { CHANNELS_SELECTORS } from "./channels-selectors"; - -export { CHANNEL_FORM_SELECTORS, CHANNELS_SELECTORS }; diff --git a/cypress/elements/channels/select-channels-to-assign.js b/cypress/elements/channels/select-channels-to-assign.js deleted file mode 100644 index 2853469c8b7..00000000000 --- a/cypress/elements/channels/select-channels-to-assign.js +++ /dev/null @@ -1,10 +0,0 @@ -export const SELECT_CHANNELS_TO_ASSIGN = { - listOfChannels: - "[data-test-id='manage-products-channels-availiability-list']", - allChannelsCheckbox: "[name='allChannels']", - selectChannelsForm: "[role='dialog']", - channelRow: "[data-test-id='channel-row']", - expandChannelRow: "[data-test-id='expand-channel-row']", - channelVariantRow: '[data-test-id="channel-variant-row"]', - channelCheckbox: "[class*='MuiCheckbox']" -}; diff --git a/cypress/elements/configuration/configuration-selectors.js b/cypress/elements/configuration/configuration-selectors.js deleted file mode 100644 index 6fbc46f310c..00000000000 --- a/cypress/elements/configuration/configuration-selectors.js +++ /dev/null @@ -1,17 +0,0 @@ -export const CONFIGURATION_SELECTORS = { - channels: "[data-test-id*='channels']", - shipping: '[data-test-id*="shipping methods"]', - taxes: '[data-test-id*="configuration-menu-taxes"]', - webhooks: '[data-test-id*="configuration-menu-webhooks"]', - settings: '[data-test-id*="configuration-menu-site-settings"]', - pageTypes: '[data-test-id*="configuration-menu-page-types"]', - navigation: '[data-test-id*="configuration-menu-navigation"]', - staffMembers: '[data-test-id*="configuration-menu-staff"]', - permissionGroups: '[data-test-id*="configuration-menu-permission-groups"]', - attributes: '[data-test-id*="configuration-menu-attributes"]', - productTypes: '[data-test-id*="configuration-menu-product-types"]', - plugin: '[data-test-id*="configuration-plugins-pages"]', - warehouse: '[data-test-id*="configuration-menu-warehouses"]', - configurationMenu: "[data-test-id='configuration-menu']", - configurationMenuItem: "[data-test-id='configuration-menu-item']", -}; diff --git a/cypress/elements/customer/customer-details.js b/cypress/elements/customer/customer-details.js deleted file mode 100644 index f956a61ae2e..00000000000 --- a/cypress/elements/customer/customer-details.js +++ /dev/null @@ -1,15 +0,0 @@ -export const CUSTOMER_DETAILS_SELECTORS = { - nameInput: '[name="firstName"]', - customerAddressNameInput: '[name="customerFirstName"]', - lastNameInput: '[name="lastName"]', - customerAddressLastNameInput: '[name="customerLastName"]', - emailInput: '[name="email"]', - noteInput: '[name="note"]', - activeCheckbox: '[name="isActive"]', - manageAddressesButton: '[data-test-id="manage-addresses"]', - addAddressButton: '[data-test-id="add-address"]', - deleteAddressMenuItem: '[data-test-id="delete-address"]', - setAddressAsDefaultShipping: '[data-test-id="set-default-shipping-address"]', - setAddressAsDefaultBilling: '[data-test-id="set-default-billing-address"]', - editAddressMenuitem: '[data-test-id="edit-address"]', -}; diff --git a/cypress/elements/customer/customers-list.js b/cypress/elements/customer/customers-list.js deleted file mode 100644 index 01e195bf362..00000000000 --- a/cypress/elements/customer/customers-list.js +++ /dev/null @@ -1,3 +0,0 @@ -export const CUSTOMERS_LIST_SELECTORS = { - createCustomerButton: '[data-test-id="create-customer"]', -}; diff --git a/cypress/elements/customer/index.js b/cypress/elements/customer/index.js deleted file mode 100644 index 7856a64c193..00000000000 --- a/cypress/elements/customer/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { CUSTOMER_DETAILS_SELECTORS } from "./customer-details"; -import { CUSTOMERS_LIST_SELECTORS } from "./customers-list"; - -export { CUSTOMER_DETAILS_SELECTORS, CUSTOMERS_LIST_SELECTORS }; diff --git a/cypress/elements/customers/customer-details.js b/cypress/elements/customers/customer-details.js deleted file mode 100644 index f898f8cc8c0..00000000000 --- a/cypress/elements/customers/customer-details.js +++ /dev/null @@ -1,3 +0,0 @@ -export const CUSTOMER_DETAILS_SELECTORS = { - isActiveCheckbox: '[name="isActive"]', -}; diff --git a/cypress/elements/discounts/index.js b/cypress/elements/discounts/index.js deleted file mode 100644 index bdc576dae3b..00000000000 --- a/cypress/elements/discounts/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { SALES_SELECTORS } from "./sales"; -import { VOUCHERS_SELECTORS } from "./vouchers"; - -export { SALES_SELECTORS, VOUCHERS_SELECTORS }; diff --git a/cypress/elements/discounts/sales.js b/cypress/elements/discounts/sales.js deleted file mode 100644 index 3790e2038cb..00000000000 --- a/cypress/elements/discounts/sales.js +++ /dev/null @@ -1,13 +0,0 @@ -export const SALES_SELECTORS = { - createSaleButton: "[data-test-id='create-sale']", - nameInput: "[name='name']", - percentageOption: "[value='PERCENTAGE']", - fixedOption: "[value='FIXED']", - discountValue: "[name='value']", - startDateInput: "[name='startDate']", - saveButton: "[data-test-id='button-bar-confirm']", - productsTab: "[data-test-id='products-tab']", - variantsTab: "[data-test-id='variants-tab']", - assignProducts: "[data-test-id='assign-products']", - assignVariants: "[data-test-id='assign-variant']", -}; diff --git a/cypress/elements/discounts/vouchers.js b/cypress/elements/discounts/vouchers.js deleted file mode 100644 index b22597c9a78..00000000000 --- a/cypress/elements/discounts/vouchers.js +++ /dev/null @@ -1,31 +0,0 @@ -export const VOUCHERS_SELECTORS = { - createVoucherButton: "[data-test-id='create-voucher']", - manualVoucherItem: "[data-test-id='manual']", - voucherCodeConfirmButton: "[data-test-id='confirm-button']", - voucherCodeAddButton: "[data-test-id='add-code-button']", - voucherCodeNameInput: "[data-test-id='enter-code-input']", - discountRadioButtons: "[name='discountType']", - percentageDiscountRadioButton: - "[name='discountType'][value='VALUE_PERCENTAGE']", - fixedDiscountRadioButton: "[name='discountType'][value='VALUE_FIXED']", - shippingDiscountRadioButton: "[name='discountType'][value='SHIPPING']", - discountValueInputs: "[name='value']", - startDateInput: '[name="startDate"]', - endDateInput: '[name="endDate"]', - hasEndDateCheckbox: '[data-test-id="has-end-date"]', - endTimeInput: '[name="endTime"]', - assignCountryButton: '[data-test-id="assign-country"]', - countriesDropdownIcon: '[data-test-id="countries-drop-down-icon"]', - limits: { - usageLimitCheckbox: '[data-test-id="has-usage-limit"]', - usageLimitTextField: '[data-test-id="usage-limit"]', - applyOncePerCustomerCheckbox: '[data-test-id="apply-once-per-customer"]', - onlyForStaffCheckbox: '[data-test-id="only-for-staff"]', - }, - requirements: { - minOrderValueCheckbox: '[name="requirementsPicker"][value="ORDER"]', - minAmountOfItemsCheckbox: '[name="requirementsPicker"][value="ITEM"]', - minCheckoutItemsQuantityInput: '[name="minCheckoutItemsQuantity"]', - minOrderValueInput: '[name="minSpent"]', - }, -}; diff --git a/cypress/elements/giftCard/giftCardDialog.js b/cypress/elements/giftCard/giftCardDialog.js deleted file mode 100644 index 50f647eef3c..00000000000 --- a/cypress/elements/giftCard/giftCardDialog.js +++ /dev/null @@ -1,18 +0,0 @@ -export const GIFT_CARD_DIALOG = { - amountInput: '[name="balanceAmount"]', - currencySelectButton: '[id="mui-component-select-balanceCurrency"]', - currenciesOptions: '[data-test-id="select-field-option"]', - expirationOptions: { - setExpiryDateCheckbox: '[name="expirySelected"]', - neverExpireRadioButton: '[value="NEVER_EXPIRE"]', - expiryPeriodRadioButton: '[value="EXPIRY_PERIOD"]', - expiryDateRadioButton: '[value="EXPIRY_DATE"]', - expiryPeriodAmount: '[name="expiryPeriodAmount"]', - expiryPeriodTypeButton: '[id*="select-expiryPeriodType"]', - expiryPeriodMonthType: '[data-test-id="MONTH"]', - expiryDateInput: '[name="expiryDate"]' - }, - noteInput: '[name="note"]', - cardCodeText: '[data-test-id="cardCode"]', - tagInput: '[data-test-id="gift-card-tag-select-field"]' -}; diff --git a/cypress/elements/header/header-selectors.js b/cypress/elements/header/header-selectors.js deleted file mode 100644 index 935421c3491..00000000000 --- a/cypress/elements/header/header-selectors.js +++ /dev/null @@ -1,4 +0,0 @@ -export const HEADER_SELECTORS = { - channelSelect: "[data-test-id='app-channel-select']", - channelSelectList: "[class*='MuiMenu-paper']" -}; diff --git a/cypress/elements/homePage/homePage-selectors.js b/cypress/elements/homePage/homePage-selectors.js deleted file mode 100644 index 62fd48d2036..00000000000 --- a/cypress/elements/homePage/homePage-selectors.js +++ /dev/null @@ -1,10 +0,0 @@ -export const HOMEPAGE_SELECTORS = { - sales: "[data-test-id='sales-analytics']", - orders: "[data-test-id='orders-analytics']", - activity: "[data-test-id='activity-card']", - topProducts: "[data-test-id='top-products']", - ordersReadyToFulfill: "[data-test-id='orders-to-fulfill']", - paymentsWaitingForCapture: "[data-test-id='orders-to-capture']", - productsOutOfStock: "[data-test-id*='out-of-stock']", - welcomeMessage: "[data-test-id='welcome-header']", -}; diff --git a/cypress/elements/index.js b/cypress/elements/index.js deleted file mode 100644 index fb50ddae0a3..00000000000 --- a/cypress/elements/index.js +++ /dev/null @@ -1,55 +0,0 @@ -export { - LOGIN_SELECTORS, - MENU_SELECTORS, - SET_PASSWORD_SELECTORS, -} from "./account/"; -export { APPS_LIST_SELECTORS } from "./apps"; -export { ATTRIBUTES_DETAILS, ATTRIBUTES_LIST } from "./attribute"; -export { - CATEGORIES_LIST_SELECTORS, - CATEGORY_DETAILS_SELECTORS, - COLLECTION_SELECTORS, - PRODUCT_DETAILS, - PRODUCTS_LIST, -} from "./catalog"; -export { CHANNEL_FORM_SELECTORS, CHANNELS_SELECTORS } from "./channels"; -export { CONFIGURATION_SELECTORS } from "./configuration/configuration-selectors"; -export { - CUSTOMER_DETAILS_SELECTORS, - CUSTOMERS_LIST_SELECTORS, -} from "./customer/"; -export { MENU as LEFT_MENU_SELECTORS } from "./account/left-menu/left-menu-selectors"; - -export { SALES_SELECTORS, VOUCHERS_SELECTORS } from "./discounts"; -export { HOMEPAGE_SELECTORS } from "./homePage/homePage-selectors"; -export { PAGINATION } from "./navigation"; -export { - ADD_PRODUCT_TO_ORDER_DIALOG, - DRAFT_ORDER_SELECTORS, - DRAFT_ORDERS_LIST_SELECTORS, - ORDER_GRANT_REFUND, - ORDER_TRANSACTION_CREATE, - ORDERS_SELECTORS, -} from "./orders"; -export { PAGE_DETAILS_SELECTORS, PAGES_LIST_SELECTORS } from "./pages/"; -export { - PAGE_TYPE_DETAILS_SELECTORS, - PAGE_TYPES_LIST_SELECTORS, -} from "./pageTypes"; -export { - PERMISSION_GROUP_DETAILS_SELECTORS, - PERMISSION_GROUP_LIST_SELECTORS, -} from "./permissionGroup"; -export { PLUGINS_DETAILS_SELECTORS, PLUGINS_LIST_SELECTORS } from "./plugins"; -export { - PRODUCT_TYPE_DETAILS_SELECTORS, - PRODUCT_TYPES_LIST_SELECTORS, -} from "./productTypes"; -export { ADDRESS_SELECTORS, BUTTON_SELECTORS, SHARED_ELEMENTS } from "./shared"; -export { SHIPPING_ZONES_LIST_SELECTORS } from "./shipping"; -export { - INVITE_STAFF_MEMBER_FORM_SELECTORS, - STAFF_MEMBER_DETAILS_SELECTORS, - STAFF_MEMBERS_LIST_SELECTORS, -} from "./staffMembers"; -export { LANGUAGES_LIST_SELECTORS } from "./translations"; diff --git a/cypress/elements/navigation/index.js b/cypress/elements/navigation/index.js deleted file mode 100644 index 2e9e3c8dbbf..00000000000 --- a/cypress/elements/navigation/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { PAGINATION } from "./pagination"; - -export { PAGINATION }; diff --git a/cypress/elements/navigation/menu-details.js b/cypress/elements/navigation/menu-details.js deleted file mode 100644 index 13f2748d645..00000000000 --- a/cypress/elements/navigation/menu-details.js +++ /dev/null @@ -1,12 +0,0 @@ -export const MENU_DETAILS = { - createNewMenuItemButton: '[data-test-id="create-new-menu-item"]', - newMenuItemForm: { - nameInput: '[name="name"]', - autocompleteSelectReference: - '[data-test-id="container-autocomplete-select"]', - categoryItem: '[data-test-id="category"]', - collectionItem: '[data-test-id="collection"]', - pageItem: '[data-test-id="page"]', - anyMenuItem: '[id="downshift-0-item-2"]' - } -}; diff --git a/cypress/elements/navigation/menu-list.js b/cypress/elements/navigation/menu-list.js deleted file mode 100644 index aec6d1520ec..00000000000 --- a/cypress/elements/navigation/menu-list.js +++ /dev/null @@ -1,6 +0,0 @@ -export const MENU_LIST = { - addMenuButton: '[data-test-id="add-menu"]', - createMenuForm: { - nameInput: '[name="name"]' - } -}; diff --git a/cypress/elements/navigation/pagination.js b/cypress/elements/navigation/pagination.js deleted file mode 100644 index d021c122c7a..00000000000 --- a/cypress/elements/navigation/pagination.js +++ /dev/null @@ -1,5 +0,0 @@ -export const PAGINATION = { - previousPagePaginationButton: "[data-test-id='button-pagination-back']", - rowNumberButton: "[data-test-id='PaginationRowNumberSelect']", - nextPagePaginationButton: "[data-test-id='button-pagination-next']", -}; diff --git a/cypress/elements/orders/draft-order-selectors.js b/cypress/elements/orders/draft-order-selectors.js deleted file mode 100644 index b7176c39ece..00000000000 --- a/cypress/elements/orders/draft-order-selectors.js +++ /dev/null @@ -1,13 +0,0 @@ -export const DRAFT_ORDER_SELECTORS = { - addProducts: "[data-test-id='add-products-button']", - salesChannel: "[data-test-id='order-sales-channel']", - editCustomerButton: "[data-test-id='edit-customer']", - selectCustomer: "[data-test-id='select-customer']", - selectCustomerOption: "[data-test-type='option']", - addShippingCarrierLink: "[data-test-id='add-shipping-carrier']", - finalizeButton: "[data-test-id='button-bar-confirm']", - editShippingAddress: '[data-test-id="edit-shipping-address"]', - editBillingAddress: '[data-test-id="edit-billing-address"]', - customerEmail: '[data-test-id="customer-email"]', - newAddressSelectButton: "[data-test-id='newAddress']", -}; diff --git a/cypress/elements/orders/draft-orders-list-selectors.js b/cypress/elements/orders/draft-orders-list-selectors.js deleted file mode 100644 index 08c34bddd66..00000000000 --- a/cypress/elements/orders/draft-orders-list-selectors.js +++ /dev/null @@ -1,4 +0,0 @@ -export const DRAFT_ORDERS_LIST_SELECTORS = { - draftOrderRow: "[data-test-id='draft-order-table-row']", - createDraftOrderButton: "[data-test-id='create-draft-order-button']", -}; diff --git a/cypress/elements/orders/index.js b/cypress/elements/orders/index.js deleted file mode 100644 index b9057547ee7..00000000000 --- a/cypress/elements/orders/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { DRAFT_ORDERS_LIST_SELECTORS } from "./draft-orders-list-selectors"; -export { - ADD_PRODUCT_TO_ORDER_DIALOG, - ORDERS_SELECTORS, -} from "./orders-selectors"; - -export { DRAFT_ORDER_SELECTORS } from "./draft-order-selectors"; -export { ORDER_GRANT_REFUND } from "./order-grant-refund"; -export { ORDER_TRANSACTION_CREATE } from "./transaction-selectors"; diff --git a/cypress/elements/orders/order-grant-refund.js b/cypress/elements/orders/order-grant-refund.js deleted file mode 100644 index cdad8ddbc1c..00000000000 --- a/cypress/elements/orders/order-grant-refund.js +++ /dev/null @@ -1,9 +0,0 @@ -export const ORDER_GRANT_REFUND = { - productsQuantityInput: '[data-test-id*="quantity-input"]', - setMaxQuantityButton: '[data-test-id="setMaxQuantityButton"]', - refundReasonInput: '[data-test-id="refundReasonInput"]', - refundShippingCheckbox: '[data-test-id="refundShippingCheckbox"]', - applySelectedRefundButton: '[data-test-id="applySelectedRefundButton"]', - refundAmountInput: '[data-test-id="amountInput"]', - grantRefundButton: '[data-test-id="grantRefundButton"]', -}; diff --git a/cypress/elements/orders/orders-selectors.js b/cypress/elements/orders/orders-selectors.js deleted file mode 100644 index dbf37434c47..00000000000 --- a/cypress/elements/orders/orders-selectors.js +++ /dev/null @@ -1,38 +0,0 @@ -export const ORDERS_SELECTORS = { - orders: "[data-test-id='menu-item-label'][data-test-id='orders']", - createOrderButton: "[data-test-id='create-order-button']", - orderRow: "[data-test-id='order-table-row']", - salesChannel: "[data-test-id='order-sales-channel']", - cancelFulfillment: "[data-test-id='cancel-fulfillment-button']", - cancelFulfillmentSelectField: - "[data-test-id='cancel-fulfillment-select-field']", - orderFulfillmentFrame: "[data-test-id='order-fulfillment']", - refundButton: '[data-test-id="refund-button"]', - fulfillMenuButton: '[data-test-id="fulfill-menu"]', - priceCellFirstRowOrderDetails: "[id='glide-cell-5-0']", - productNameOrderDetailsRow: "'[id='glide-cell-0-0']'", - productNameSecondRowOrderDetails: "[id='glide-cell-1-1']", - quantityCellFirstRowOrderDetails: "[id='glide-cell-4-0']", - gridClip: "[class='clip-region']", - discountFixedPriceButton: '[data-test-id="FIXED"]', - discountAmountField: '[data-test-id="price-field"]', - discountReasonField: '[data-test-id="discount-reason"]', - orderSummarySubtotalPriceRow: '[data-test-id="order-subtotal-price"]', - orderSummaryTotalPriceRow: '[data-test-id="order-total-price"]', - dataGridTable: "[data-testid='data-grid-canvas']", - productDeleteFromRowButton: "[data-test-id='delete-order-line']", - markAsPaidButton: '[data-test-id="markAsPaidButton"]', - grantRefundButton: '[data-test-id="grantRefundButton"]', - transactionReferenceInput: '[data-test-id="transaction-reference-input"]', - orderTransactionsList: '[data-test-id="orderTransactionsList"]', - openProductDetailsButton: '[data-test-id="open-product-details"]', - rowActionButton: '[data-test-id="row-action-button"]', - captureManualTransactionButton: - '[data-test-id="captureManualTransactionButton"]', -}; -export const ADD_PRODUCT_TO_ORDER_DIALOG = { - productRow: "[data-test-id='product']", - productName: "[data-test-id='product-name']", - productVariant: "[data-test-id='variant']", - checkbox: "[data-test-id='checkbox']", -}; diff --git a/cypress/elements/orders/transaction-selectors.js b/cypress/elements/orders/transaction-selectors.js deleted file mode 100644 index ade51a6d1ac..00000000000 --- a/cypress/elements/orders/transaction-selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -export const ORDER_TRANSACTION_CREATE = { - transactionDescription: '[data-test-id="transactionDescription"]', - transactionPspReference: '[data-test-id="transactionPspReference"]', - transactAmountInput: '[data-test-id="transactAmountInput"]', - manualTransactionSubmit: '[data-test-id="manualTransactionSubmit"]', -}; diff --git a/cypress/elements/pageTypes/index.js b/cypress/elements/pageTypes/index.js deleted file mode 100644 index f816d095170..00000000000 --- a/cypress/elements/pageTypes/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { PAGE_TYPE_DETAILS_SELECTORS } from "./pageTypeDetails"; -import { PAGE_TYPES_LIST_SELECTORS } from "./pageTypesList"; - -export { PAGE_TYPE_DETAILS_SELECTORS, PAGE_TYPES_LIST_SELECTORS }; diff --git a/cypress/elements/pageTypes/pageTypeDetails.js b/cypress/elements/pageTypes/pageTypeDetails.js deleted file mode 100644 index 7cdeafb0585..00000000000 --- a/cypress/elements/pageTypes/pageTypeDetails.js +++ /dev/null @@ -1,4 +0,0 @@ -export const PAGE_TYPE_DETAILS_SELECTORS = { - nameInput: '[name="name"]', - assignAttributesButton: '[data-test-id="assign-attributes"]', -}; diff --git a/cypress/elements/pageTypes/pageTypesList.js b/cypress/elements/pageTypes/pageTypesList.js deleted file mode 100644 index 3bbb09c3ba5..00000000000 --- a/cypress/elements/pageTypes/pageTypesList.js +++ /dev/null @@ -1,3 +0,0 @@ -export const PAGE_TYPES_LIST_SELECTORS = { - createPageTypeButton: '[data-test-id="create-page-type"]', -}; diff --git a/cypress/elements/pages/index.js b/cypress/elements/pages/index.js deleted file mode 100644 index 4037f6e8f8f..00000000000 --- a/cypress/elements/pages/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { PAGE_DETAILS_SELECTORS } from "./page-details"; -import { PAGES_LIST_SELECTORS } from "./pages-list"; - -export { PAGE_DETAILS_SELECTORS, PAGES_LIST_SELECTORS }; diff --git a/cypress/elements/pages/page-details.js b/cypress/elements/pages/page-details.js deleted file mode 100644 index 0f8079d1970..00000000000 --- a/cypress/elements/pages/page-details.js +++ /dev/null @@ -1,11 +0,0 @@ -export const PAGE_DETAILS_SELECTORS = { - nameInput: '[name="title"]', - pageTypesAutocompleteSelect: - '[data-test-id="page-types-autocomplete-select"]', - attributeValues: '[data-test-id="attribute-value"]', - isNotPublishedCheckbox: '[name="isPublished"][value=false]', - uploadFileButton: '[data-test-id="button-upload-file"]', - richTextEditorAttributeValue: '[class*="ce-paragraph"]', - booleanAttributeValueCheckbox: '[data-macaw-ui-component="Toggle"]', - numericAttributeValueInput: '[name*="attribute:"]', -}; diff --git a/cypress/elements/pages/pages-list.js b/cypress/elements/pages/pages-list.js deleted file mode 100644 index 894c21fa8b2..00000000000 --- a/cypress/elements/pages/pages-list.js +++ /dev/null @@ -1,5 +0,0 @@ -export const PAGES_LIST_SELECTORS = { - createPageButton: '[data-test-id="create-page"]', - dialogPageTypeInput: "[data-test-id='dialog-page-type']", - dialogPageTypeInputOptions: "[data-test-id='select-option']", -}; diff --git a/cypress/elements/permissionGroup/index.js b/cypress/elements/permissionGroup/index.js deleted file mode 100644 index 5161f33efcf..00000000000 --- a/cypress/elements/permissionGroup/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { PERMISSION_GROUP_DETAILS_SELECTORS } from "./permissionGroupDetails"; -import { PERMISSION_GROUP_LIST_SELECTORS } from "./permissionGroupsList"; - -export { PERMISSION_GROUP_DETAILS_SELECTORS, PERMISSION_GROUP_LIST_SELECTORS }; diff --git a/cypress/elements/permissionGroup/permissionGroupDetails.js b/cypress/elements/permissionGroup/permissionGroupDetails.js deleted file mode 100644 index 1866cc83826..00000000000 --- a/cypress/elements/permissionGroup/permissionGroupDetails.js +++ /dev/null @@ -1,10 +0,0 @@ -export const PERMISSION_GROUP_DETAILS_SELECTORS = { - nameInput: '[name="name"]', - productsPermissionCheckbox: '[name="MANAGE_PRODUCTS"]', - productsTypesAndAttributesPermissionCheckbox: - '[name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"]', - assignMemberButton: '[data-test-id="assign-members"]', - searchField: '[name="query"]', - removeUserButton: '[data-test-id="remove-user"]', - userRow: '[data-test-id="user-row"]', -}; diff --git a/cypress/elements/permissionGroup/permissionGroupsList.js b/cypress/elements/permissionGroup/permissionGroupsList.js deleted file mode 100644 index c2618fff9c9..00000000000 --- a/cypress/elements/permissionGroup/permissionGroupsList.js +++ /dev/null @@ -1,4 +0,0 @@ -export const PERMISSION_GROUP_LIST_SELECTORS = { - createPermissionButton: '[data-test-id="create-permission-group"]', - permissionGroupRow: '[data-test-id*="id-"]', -}; diff --git a/cypress/elements/plugins/index.js b/cypress/elements/plugins/index.js deleted file mode 100644 index cd45eb32a24..00000000000 --- a/cypress/elements/plugins/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { PLUGINS_DETAILS_SELECTORS } from "./pluginDetails"; -import { PLUGINS_LIST_SELECTORS } from "./pluginsList"; - -export { PLUGINS_DETAILS_SELECTORS, PLUGINS_LIST_SELECTORS }; diff --git a/cypress/elements/plugins/pluginDetails.js b/cypress/elements/plugins/pluginDetails.js deleted file mode 100644 index 6ca7fbb8702..00000000000 --- a/cypress/elements/plugins/pluginDetails.js +++ /dev/null @@ -1,5 +0,0 @@ -export const PLUGINS_DETAILS_SELECTORS = { - channel: '[data-test-id="channel"]', - accountConfirmationSubjectInput: '[name="account_confirmation_subject"]', - staffPasswordResetInput: '[name="staff_password_reset_subject"]', -}; diff --git a/cypress/elements/plugins/pluginsList.js b/cypress/elements/plugins/pluginsList.js deleted file mode 100644 index f23b19ff5c5..00000000000 --- a/cypress/elements/plugins/pluginsList.js +++ /dev/null @@ -1,3 +0,0 @@ -export const PLUGINS_LIST_SELECTORS = { - pluginRow: '[data-test-id="plugin"]', -}; diff --git a/cypress/elements/productTypes/index.js b/cypress/elements/productTypes/index.js deleted file mode 100644 index 8ef88f30d8b..00000000000 --- a/cypress/elements/productTypes/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { PRODUCT_TYPE_DETAILS_SELECTORS } from "./productTypeDetails"; -import { PRODUCT_TYPES_LIST_SELECTORS } from "./productTypesList"; - -export { PRODUCT_TYPE_DETAILS_SELECTORS, PRODUCT_TYPES_LIST_SELECTORS }; diff --git a/cypress/elements/productTypes/productTypeDetails.js b/cypress/elements/productTypes/productTypeDetails.js deleted file mode 100644 index df3538a41df..00000000000 --- a/cypress/elements/productTypes/productTypeDetails.js +++ /dev/null @@ -1,10 +0,0 @@ -export const PRODUCT_TYPE_DETAILS_SELECTORS = { - nameInput: '[name="name"]', - isShippingRequired: '[name="isShippingRequired"]', - assignProductAttributeButton: '[data-test-id="assign-products-attributes"]', - assignVariantAttributeButton: '[data-test-id="assign-variants-attributes"]', - hasVariantsButton: '[name="hasVariants"]', - shippingWeightInput: '[name="weight"]', - giftCardKindCheckbox: '[data-test-id="product-type-kind-option-GIFT_CARD"]', - variantSelectionCheckbox: '[data-test-id = "variant-selection-checkbox"]', -}; diff --git a/cypress/elements/productTypes/productTypesList.js b/cypress/elements/productTypes/productTypesList.js deleted file mode 100644 index 64e40ba31ef..00000000000 --- a/cypress/elements/productTypes/productTypesList.js +++ /dev/null @@ -1,3 +0,0 @@ -export const PRODUCT_TYPES_LIST_SELECTORS = { - addProductTypeButton: '[data-test-id="add-product-type"]', -}; diff --git a/cypress/elements/shared/addressForm.js b/cypress/elements/shared/addressForm.js deleted file mode 100644 index d18396e47e3..00000000000 --- a/cypress/elements/shared/addressForm.js +++ /dev/null @@ -1,14 +0,0 @@ -export const ADDRESS_SELECTORS = { - firstName: '[name="firstName"]', - lastName: '[name="lastName"]', - companyName: '[name="companyName"]', - phone: '[name="phone"]', - streetAddress1: '[name="streetAddress1"]', - streetAddress2: '[name="streetAddress2"]', - city: '[name="city"]', - postalCode: '[name="postalCode"]', - country: '[data-test-id="address-edit-country-select-field"]', - countryArea: '[data-test-id="address-edit-country-area-field"]', - saveButton: '[data-test-id="order-address-edit-dialog-confirm-button"]', - companyInfoSection: '[data-test-id="company-info"]', -}; diff --git a/cypress/elements/shared/assign-elements-selectors.js b/cypress/elements/shared/assign-elements-selectors.js deleted file mode 100644 index 7d2e31d7d1d..00000000000 --- a/cypress/elements/shared/assign-elements-selectors.js +++ /dev/null @@ -1,9 +0,0 @@ -export const ASSIGN_ELEMENTS_SELECTORS = { - searchInput: "[name='query']", - tableRow: "[class*='MuiTableRow']", - productTableRow: "[data-test-id='assign-product-table-row']", - variantTableRow: "[data-test-id='assign-variant-table-row']", - checkbox: "[type='checkbox']", - submitButton: "[type='submit']", - dialogContent: '[data-test-id="search-query"]' -}; diff --git a/cypress/elements/shared/button-selectors.js b/cypress/elements/shared/button-selectors.js deleted file mode 100644 index 95b657951bb..00000000000 --- a/cypress/elements/shared/button-selectors.js +++ /dev/null @@ -1,26 +0,0 @@ -export const BUTTON_SELECTORS = { - back: '[data-test-id="app-header-back-button"]', - submit: '[data-test-id="submit"]', - confirm: '[data-test-id="button-bar-confirm"]', - confirmButton: '[data-test-id="confirm-button"]', - goBackButton: "[data-test-id='app-header-back-button']", - checkbox: "[type='checkbox']", - checked: "[class*='checked']", - selectOption: "[data-test-id*='select-option']", - notSelectedOption: ":not([aria-selected])", - deleteButton: '[data-test-id="button-bar-delete"]', - deleteProductsButton: '[data-test-id="bulk-delete-button"]', - deleteItemsButton: '[data-test-id="button-delete-items"]', - confirmDeleteButton: '[data-test-id="confirm-delete"]', - expandIcon: '[data-test-id="expand-icon"]', - nextPaginationButton: '[data-test-id="button-pagination-next"]', - deleteIcon: '[data-test-id="delete-icon"]', - showMoreButton: '[data-test-id="show-more-button"]', - button: "button", - deleteAssignedItemsConsentCheckbox: '[name="delete-assigned-items-consent"]', - deleteSelectedElementsButton: - '[data-test-id = "delete-selected-elements-icon"]', - dialogBackButton: '[data-test-id="back"]', - expandMetadataButton: '[data-test-id="expand"]', - bulkDeleteButton: '[data-test-id="bulk-delete-button"]', -}; diff --git a/cypress/elements/shared/index.js b/cypress/elements/shared/index.js deleted file mode 100644 index 9c6ae5eec82..00000000000 --- a/cypress/elements/shared/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { ADDRESS_SELECTORS } from "./addressForm"; -export { BUTTON_SELECTORS } from "./button-selectors"; -export { PRESETS, SEARCH } from "./presetsAndSearch"; -export { SHARED_ELEMENTS } from "./sharedElements"; diff --git a/cypress/elements/shared/metadata/metadata-form.js b/cypress/elements/shared/metadata/metadata-form.js deleted file mode 100644 index f255cb54a7f..00000000000 --- a/cypress/elements/shared/metadata/metadata-form.js +++ /dev/null @@ -1,14 +0,0 @@ -export const METADATA_FORM = { - metadataForm: - "[data-test-id='metadata-editor'][data-test-is-private='false']", - privateMetadataForm: - "[data-test-id='metadata-editor'][data-test-is-private='true']", - addFieldButton: "[data-test-id='add-field']", - nameInput: "[name*='name']", - valueField: "[name*='value']", - metaExpandButton: "[data-test-id='expand']", - metaDeletedButton: "[data-test-id='delete-field-0']", - privateMetaSection: "[data-test-is-private='true']", - publicMetaSection: "[data-test-is-private='false']", - fulfillmentMetaSection: "[data-test-id='fulfilled-order-section']", -}; diff --git a/cypress/elements/shared/presetsAndSearch.js b/cypress/elements/shared/presetsAndSearch.js deleted file mode 100644 index f9cbc9d98c2..00000000000 --- a/cypress/elements/shared/presetsAndSearch.js +++ /dev/null @@ -1,12 +0,0 @@ -export const PRESETS = { - addPresetButton: "[data-test-id='add-preset-button']", - presetNameTextField: '[data-test-id="preset-name-text-field"]', - savePresetNameButton: '[data-test-id="save-preset-button"]', - activePresetName: '[data-test-id="show-saved-filters-button"]', - presetDeleteButton: '[data-test-id="preset-delete-button"]', - savedPreset: '[data-test-id="preset"]', - updatePresetButton: '[data-test-id="update-preset-button"]', -}; -export const SEARCH = { - searchInput: "[data-test-id='search-input']", -}; diff --git a/cypress/elements/shared/seo/seo-form-selectors.js b/cypress/elements/shared/seo/seo-form-selectors.js deleted file mode 100644 index 58bfc7cc0ba..00000000000 --- a/cypress/elements/shared/seo/seo-form-selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -export const SEO_FORM = { - editSeoSettings: "[data-test-id='edit-seo']", - slugInput: "[name='slug']", - titleInput: "[name='seoTitle']", - descriptionInput: "[name='seoDescription']" -}; diff --git a/cypress/elements/shared/sharedElements.js b/cypress/elements/shared/sharedElements.js deleted file mode 100644 index e9c8e7ed0ae..00000000000 --- a/cypress/elements/shared/sharedElements.js +++ /dev/null @@ -1,69 +0,0 @@ -export const SHARED_ELEMENTS = { - body: "body", - header: "[data-test-id='page-header']", - progressBar: '[role="progressbar"]', - rowNumberOption: "[data-test-id='rowNumberOption']", - circularProgress: '[class*="CircularProgress-circle"]', - autocompleteCircle: '[class*="arrowInnerContainer"]', - dataGridTable: "[data-testid='data-grid-canvas']", - skeleton: '[data-test-id="skeleton"]', - table: 'table[class*="Table"]', - firstRowDataGrid: "[data-testid='glide-cell-1-0']", - secondRowDataGrid: "[id='glide-cell-1-1']", - openColumnPickerButton: "[data-test-id='open-column-picker-button']", - openDynamicColumnsSearchButton: "[data-test-id='open-dynamic-search']", - tableRow: '[data-test-id*="id"], [class*="MuiTableRow"]', - activeStaticColumnOnGridButton: '[data-state="on"]', - dynamicColumnSelector: '[data-test-id="dynamic-column"]', - dynamicColumnNameSelector: '[data-test-id^="dynamic-column-name"]', - gridStaticSkuButton: '[data-test-id="stat-col-sku"]', - gridStaticVariantNameButton: '[data-test-id="stat-col-variantName"]', - gridStaticQuantityButton: '[data-test-id="stat-col-quantity"]', - gridStaticPriceButton: '[data-test-id="stat-col-price"]', - gridStaticStatusButton: '[data-test-id="stat-col-status"]', - gridStaticTotalButton: '[data-test-id="stat-col-total"]', - gridStaticIsGiftButton: '[data-test-id="stat-col-isGift"]', - gridStaticProductButton: '[data-test-id="stat-col-product"]', - gridStaticMetadataButton: '[data-test-id="stat-col-metadata"]', - dynamicColumnSearchInput: '[data-test-id="search-columns"]', - selectedDynamicColumnNameSelector: '[data-test-id^="column-name-"]', - removeSelectedDynamicColumnButton: - '[data-test-id^="remove-dynamic-col-button"]', - dynamicColumnContainer: '[data-test-id="dynamic-col-container"]', - staticColumnContainer: '[data-test-id="static-col-container"]', - paginationForwardOnColumnPicker: '[data-test-id="pagination-forward"]', - paginationBackOnColumnPicker: '[data-test-id="pagination-back"]', - notificationSuccess: - '[data-test-id="notification"][data-test-type="success"]', - notificationFailure: '[data-test-id="notification"][data-test-type="error"]', - notificationMessage: '[data-test-id="notification-message"]', - dialog: '[role="dialog"]', - searchInput: '[data-test-id="search-input"]', - selectOption: '[data-test-id*="select-field-option"]', - svgImage: "svg", - fileInput: 'input[type="file"]', - pageHeader: '[data-test-id="page-header"]', - urlInput: 'input[type="url"]', - richTextEditor: { - loader: '[class*="codex-editor__loader"]', - empty: '[class*="codex-editor--empty"]', - }, - contentEditable: '[contenteditable="true"]', - filters: { - filterGroupActivateCheckbox: '[data-test-id*="filter-group-active"]', - filterRow: '[data-test-id*="channel-availability-item"]', - }, - warningDialog: '[data-test-id="warning-dialog"]', - pageHeader: "[data-test-id='page-header']", - multiselect: { - selectedOptions: '[data-test-id*="selected-option-"]', - }, - multiAutocomplete: { - selectedOptions: '[id*="selected-option-"]', - }, -}; - -export const selectorWithDataValue = value => `[data-value="${value}"]`; - -export const getElementByDataTestId = dataTestId => - `[data-test-id*=${dataTestId}]`; diff --git a/cypress/elements/shared/unsavedChangesDialog.js b/cypress/elements/shared/unsavedChangesDialog.js deleted file mode 100644 index 3452a3e9dd4..00000000000 --- a/cypress/elements/shared/unsavedChangesDialog.js +++ /dev/null @@ -1,4 +0,0 @@ -export const UNSAVED_CHANGES_DIALOG = { - keepEditingButton: '[data-test-id="keep-editing"]', - ignoreChangesButton: '[data-test-id="ignore-changes"]', -}; diff --git a/cypress/elements/shipping/index.js b/cypress/elements/shipping/index.js deleted file mode 100644 index 3cf0df771b6..00000000000 --- a/cypress/elements/shipping/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { SHIPPING_ZONES_LIST_SELECTORS } from "./shipping-zones-list"; - -export { SHIPPING_ZONES_LIST_SELECTORS }; diff --git a/cypress/elements/shipping/select-shipping-method-form.js b/cypress/elements/shipping/select-shipping-method-form.js deleted file mode 100644 index ba97146a436..00000000000 --- a/cypress/elements/shipping/select-shipping-method-form.js +++ /dev/null @@ -1,5 +0,0 @@ -export const SELECT_SHIPPING_METHOD_FORM = { - selectShippingMethod: "[id='mui-component-select-shippingMethod']", - shippingMethodOption: "[data-test-id*='select-field-option']", - submitButton: "[type='submit']" -}; diff --git a/cypress/elements/shipping/shipping-rate-details.js b/cypress/elements/shipping/shipping-rate-details.js deleted file mode 100644 index 320730eb8ca..00000000000 --- a/cypress/elements/shipping/shipping-rate-details.js +++ /dev/null @@ -1,16 +0,0 @@ -export const SHIPPING_RATE_DETAILS = { - inputName: "[name='name']", - priceInput: "[name='price']", - includePostalCodesCheckbox: '[value="INCLUDE"]', - excludePostalCodesCheckbox: '[value="EXCLUDE"]', - addPostalCodesButton: '[data-test-id="add-postal-code-range"]', - postalCodesForm: { - min: '[name="min"]', - max: '[name="max"]' - }, - maxValueInput: '[name*="maxValue"]', - minValueInput: '[name*="minValue"]', - minDeliveryTimeInput: '[name="minDays"]', - maxDeliveryTimeInput: '[name="maxDays"]', - restrictWeightLimitCheckbox: '[name="orderValueRestricted"]' -}; diff --git a/cypress/elements/shipping/shipping-zone-details.js b/cypress/elements/shipping/shipping-zone-details.js deleted file mode 100644 index a5384198c16..00000000000 --- a/cypress/elements/shipping/shipping-zone-details.js +++ /dev/null @@ -1,17 +0,0 @@ -export const SHIPPING_ZONE_DETAILS = { - assignCountryButton: "[data-test-id='assign-country']", - descriptionInput: "[data-test-id='shipping-zone-description']", - submitAssignCountry: "[type='submit']", - searchInput: "[name='query']", - tableRow: "[class*='MuiTableRow']", - addPriceRateButton: "[data-test-id='add-price-rate']", - addWeightRateButton: "[data-test-id='add-weight-rate']", - nameInput: "[data-test-id='shipping-zone-name']", - shippingRatePriceTableCell: "[data-test-id='shipping-rate-price']", - autocompleteContentDialog: - "[data-test-id='multi-autocomplete-select-content']", - option: "[data-test-id='multi-autocomplete-select-option']", - warehouseSelector: "[testId='warehouses']", - channelSelector: "[testId='channels']", - removeWarehouseButton: "[data-test-id='warehouses-remove']", -}; diff --git a/cypress/elements/shipping/shipping-zones-list.js b/cypress/elements/shipping/shipping-zones-list.js deleted file mode 100644 index e246dd87714..00000000000 --- a/cypress/elements/shipping/shipping-zones-list.js +++ /dev/null @@ -1,15 +0,0 @@ -export const SHIPPING_ZONES_LIST_SELECTORS = { - addShippingZone: "[data-test-id='add-shipping-zone']", - unitSelect: "[id='mui-component-select-unit']", - saveUnit: '[data-test-id="save-unit"]', - settingsButton: '[data-test-id="show-more-button"]', - changeDefaultWeightUnitButton: '[data-test-id="weight-unit-configuration"]', - weightUnitSelector: '[name="unit"] span', - saveUnitsButton: '[data-test-id="save-unit"]', -}; - -export const SHIPPING_ZONE_CHECKBOX = shippingId => - `[data-test-id="${shippingId}-checkbox"]`; - -export const SHIPPING_ZONE_NAME = shippingId => - `[data-test-id="${shippingId}-name"]`; diff --git a/cypress/elements/siteSettings/site-settings-details.js b/cypress/elements/siteSettings/site-settings-details.js deleted file mode 100644 index a2a89728b76..00000000000 --- a/cypress/elements/siteSettings/site-settings-details.js +++ /dev/null @@ -1,6 +0,0 @@ -export const SITE_SETTINGS_DETAILS = { - stockReservationAuthenticatedUserInput: - '[name="reserveStockDurationAuthenticatedUser"]', - stockReservationAnonymousUserInput: - '[name="reserveStockDurationAnonymousUser"]', -}; diff --git a/cypress/elements/staffMembers/index.js b/cypress/elements/staffMembers/index.js deleted file mode 100644 index 69ef6a16088..00000000000 --- a/cypress/elements/staffMembers/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import { INVITE_STAFF_MEMBER_FORM_SELECTORS } from "./inviteStaffMemberForm"; -import { STAFF_MEMBER_DETAILS_SELECTORS } from "./staffMemberDetails"; -import { STAFF_MEMBERS_LIST_SELECTORS } from "./staffMembersList"; - -export { - INVITE_STAFF_MEMBER_FORM_SELECTORS, - STAFF_MEMBER_DETAILS_SELECTORS, - STAFF_MEMBERS_LIST_SELECTORS, -}; diff --git a/cypress/elements/staffMembers/inviteStaffMemberForm.js b/cypress/elements/staffMembers/inviteStaffMemberForm.js deleted file mode 100644 index d1ff1deecff..00000000000 --- a/cypress/elements/staffMembers/inviteStaffMemberForm.js +++ /dev/null @@ -1,6 +0,0 @@ -export const INVITE_STAFF_MEMBER_FORM_SELECTORS = { - firstNameInput: '[name="firstName"]', - lastNameInput: '[name="lastName"]', - emailInput: '[name="email"]', - emailValidationMessage: "[data-test-id='email-text-input-helper-text']", -}; diff --git a/cypress/elements/staffMembers/staffMemberDetails.js b/cypress/elements/staffMembers/staffMemberDetails.js deleted file mode 100644 index 6c815db010b..00000000000 --- a/cypress/elements/staffMembers/staffMemberDetails.js +++ /dev/null @@ -1,13 +0,0 @@ -export const STAFF_MEMBER_DETAILS_SELECTORS = { - permissionsSelect: '[data-test-id="permission-groups"]', - isActiveCheckBox: '[name="isActive"]', - removePermissionButton: '[data-test-id="remove"]', - staffEmail: '[data-test-id="staffEmail"]', - staffFirstName: '[data-test-id="staffFirstName"]', - staffLastName: '[data-test-id="staffLastName', - changePasswordBtn: '[data-test-id="changePasswordBtn"]', - changePasswordModal: { - oldPassword: 'input[name="oldPassword"]', - newPassword: 'input[name="newPassword"]', - }, -}; diff --git a/cypress/elements/staffMembers/staffMembersList.js b/cypress/elements/staffMembers/staffMembersList.js deleted file mode 100644 index c9eff9ab5e9..00000000000 --- a/cypress/elements/staffMembers/staffMembersList.js +++ /dev/null @@ -1,6 +0,0 @@ -export const STAFF_MEMBERS_LIST_SELECTORS = { - inviteStaffMemberButton: '[data-test-id="invite-staff-member"]', - staffStatusText: '[data-test-id="staffStatusText"]', - staffAvatar: '[data-test-id="staffAvatar"]', - usersEmails: '[data-test-id="user-mail"]', -}; diff --git a/cypress/elements/translations/element-translation.js b/cypress/elements/translations/element-translation.js deleted file mode 100644 index 756ce8778cf..00000000000 --- a/cypress/elements/translations/element-translation.js +++ /dev/null @@ -1,8 +0,0 @@ -export const ELEMENT_TRANSLATION = { - editNameButton: '[data-test-id="edit-name"]', - editDescriptionButton: '[data-test-id="edit-description"]', - editSeoTitleButton: '[data-test-id="edit-seoTitle"]', - editSeoDescriptionButton: '[data-test-id="edit-seoDescription"]', - translationInputField: '[data-test-id="translation-field"]', - translationTextEditor: '[data-test-id="rich-text-editor-translation"]' -}; diff --git a/cypress/elements/translations/index.js b/cypress/elements/translations/index.js deleted file mode 100644 index fbf54f3e72b..00000000000 --- a/cypress/elements/translations/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { LANGUAGES_LIST_SELECTORS } from "./languages-list"; - -export { LANGUAGES_LIST_SELECTORS }; diff --git a/cypress/elements/translations/languages-list.js b/cypress/elements/translations/languages-list.js deleted file mode 100644 index af80c8dad83..00000000000 --- a/cypress/elements/translations/languages-list.js +++ /dev/null @@ -1,4 +0,0 @@ -export const LANGUAGES_LIST_SELECTORS = { - polishLanguageButton: '[data-test-id="PL"]', - translationListView: '[data-test-id="translation-list-view"]', -}; diff --git a/cypress/elements/warehouses/warehouse-details.js b/cypress/elements/warehouses/warehouse-details.js deleted file mode 100644 index 80ec23047a7..00000000000 --- a/cypress/elements/warehouses/warehouse-details.js +++ /dev/null @@ -1,9 +0,0 @@ -export const WAREHOUSES_DETAILS = { - nameInput: '[name="name"]', - privateRadioButton: '[name="isPrivate"][value=true]', - publicRadioButton: '[name="isPrivate"][value=false]', - clickAndCollectAllWarehousesRadioButton: - '[name="clickAndCollectOption"][value="ALL"]', - clickAndCollectLocalStockRadioButton: - '[name="clickAndCollectOption"][value="LOCAL"]' -}; diff --git a/cypress/elements/warehouses/warehouses-list.js b/cypress/elements/warehouses/warehouses-list.js deleted file mode 100644 index fba26ed86b0..00000000000 --- a/cypress/elements/warehouses/warehouses-list.js +++ /dev/null @@ -1,3 +0,0 @@ -export const WAREHOUSES_LIST = { - createNewButton: '[data-test-id="create-warehouse"]' -}; diff --git a/cypress/fixtures/addresses.json b/cypress/fixtures/addresses.json deleted file mode 100644 index 64dc6278491..00000000000 --- a/cypress/fixtures/addresses.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "plAddress": { - "firstName": "test", - "lastName": "test", - "companyName": "Test3", - "streetAddress1": "Smolna", - "streetAddress2": "13/1", - "city": "WrocÅ‚aw", - "postalCode": "53-346", - "country": "PL", - "countryArea": "Dolny ÅšlÄ…sk", - "phone": "123456787", - "currency": "PLN", - "countryFullName": "Poland" - }, - "usAddress": { - "firstName": "test", - "lastName": "test", - "companyName": "Test2", - "streetAddress1": "Antonio Ridge", - "streetAddress2": "34930", - "city": "North Patrickfort", - "postalCode": "70957", - "country": "US", - "countryArea": "LA", - "countryAreaFullName": "Louisiana", - "phone": "+12025550189", - "currency": "USD", - "countryFullName": "United States of America" - }, - "secondUsAddress": { - "firstName": "test", - "lastName": "test", - "companyName": "Test1", - "streetAddress1": "Rock Quarry Rd", - "streetAddress2": "345", - "city": "Afton", - "postalCode": "37745", - "country": "US", - "countryArea": "TN", - "countryAreaFullName": "Tennessee", - "phone": "+12025550169", - "currency": "USD", - "countryFullName": "United States of America" - } -} \ No newline at end of file diff --git a/cypress/fixtures/bodyMocks/demo/home.json b/cypress/fixtures/bodyMocks/demo/home.json deleted file mode 100644 index 66a2337092f..00000000000 --- a/cypress/fixtures/bodyMocks/demo/home.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "data": { - "salesToday": { - "gross": { - "amount": 190.0, - "currency": "PLN", - "__typename": "Money" - }, - "__typename": "TaxedMoney" - }, - "ordersToday": { - "totalCount": 310, - "__typename": "OrderCountableConnection" - }, - "ordersToFulfill": { - "totalCount": 2, - "__typename": "OrderCountableConnection" - }, - "ordersToCapture": { - "totalCount": 2, - "__typename": "OrderCountableConnection" - }, - "productsOutOfStock": { - "totalCount": 0, - "__typename": "ProductCountableConnection" - }, - "productTopToday": { - "edges": [], - "__typename": "ProductVariantCountableConnection" - }, - "activities": { - "edges": [ - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T21:52:58.137000+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5NzI=", - "message": null, - "orderNumber": "11591", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:02:28.234257+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5NzU=", - "message": null, - "orderNumber": "11592", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:03:10.694111+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5Nzg=", - "message": null, - "orderNumber": "11593", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:04:26.617028+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5ODE=", - "message": null, - "orderNumber": "11594", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:06:50.657651+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5ODQ=", - "message": null, - "orderNumber": "11595", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:07:26.956180+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5ODc=", - "message": null, - "orderNumber": "11596", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:08:41.140369+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5OTA=", - "message": null, - "orderNumber": "11597", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:14:18.581224+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5OTM=", - "message": null, - "orderNumber": "11598", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:16:33.599899+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5OTY=", - "message": null, - "orderNumber": "11599", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - }, - { - "node": { - "amount": null, - "composedId": null, - "date": "2023-03-22T22:17:37.483381+00:00", - "email": null, - "emailType": null, - "id": "T3JkZXJFdmVudDo5OTk=", - "message": null, - "orderNumber": "11600", - "oversoldItems": null, - "quantity": null, - "type": "PLACED", - "user": null, - "__typename": "OrderEvent" - }, - "__typename": "OrderEventCountableEdge" - } - ], - "__typename": "OrderEventCountableConnection" - } - }, - "extensions": { - "cost": { - "requestedQueryCost": 20, - "maximumAvailable": 50000 - } - } -} \ No newline at end of file diff --git a/cypress/fixtures/bodyMocks/index.js b/cypress/fixtures/bodyMocks/index.js deleted file mode 100644 index 8a100240bfa..00000000000 --- a/cypress/fixtures/bodyMocks/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { bodyMockHomePage } from "./demo/home"; - -export { bodyMockHomePage }; diff --git a/cypress/fixtures/cards.json b/cypress/fixtures/cards.json deleted file mode 100644 index a23455250cf..00000000000 --- a/cypress/fixtures/cards.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "adyen": { - "clientData": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZpY2VGaW5nZXJwcmludCI6InpabUlDMEVYOHcwMDMwMDAwMDAwMDAwMDAwS1piSVFqNmt6czAwNjA4MjQxOTBjVkI5NGlLekJHS1IybWJMc3JmckFKUEdCY2JHSG0wMDZpdmJTdVlkRzBSMDAwMDBZVnhFcjAwMDAwVk1yM0h5dHhQNmlaQ3FuSTRsc2s6NDAiLCJwZXJzaXN0ZW50Q29va2llIjpbXSwiY29tcG9uZW50cyI6eyJ1c2VyQWdlbnQiOiJkYzJjNDM2MThlOTM0YjY2NmIwOWIxNmEzZDE4NmViZCIsIndlYmRyaXZlciI6MCwibGFuZ3VhZ2UiOiJwbC1QTCIsImNvbG9yRGVwdGgiOjMwLCJkZXZpY2VNZW1vcnkiOjgsInBpeGVsUmF0aW8iOjIsImhhcmR3YXJlQ29uY3VycmVuY3kiOjEyLCJzY3JlZW5XaWR0aCI6MTc5Miwic2NyZWVuSGVpZ2h0IjoxMTIwLCJhdmFpbGFibGVTY3JlZW5XaWR0aCI6MTc5MiwiYXZhaWxhYmxlU2NyZWVuSGVpZ2h0IjoxMDMwLCJ0aW1lem9uZU9mZnNldCI6LTEyMCwidGltZXpvbmUiOiJFdXJvcGUvV2Fyc2F3Iiwic2Vzc2lvblN0b3JhZ2UiOjEsImxvY2FsU3RvcmFnZSI6MSwiaW5kZXhlZERiIjoxLCJhZGRCZWhhdmlvciI6MCwib3BlbkRhdGFiYXNlIjoxLCJwbGF0Zm9ybSI6Ik1hY0ludGVsIiwicGx1Z2lucyI6ImMxMzU2NDM4NzUxNzZkZWU5MTkyZTE5ZDRkOGM3YTkwIiwiY2FudmFzIjoiZDYxNjRlNzA3ZWQ4NDdlNTE4OGE1YjUyMDhmNDI1OGIiLCJ3ZWJnbCI6IjcwM2ZjZWMyM2MxNjhlYjAzNmM0MjA3MzA1ODYzZmNlIiwid2ViZ2xWZW5kb3JBbmRSZW5kZXJlciI6IkludGVsIEluYy5+SW50ZWwoUikgVUhEIEdyYXBoaWNzIDYzMCIsImFkQmxvY2siOjAsImhhc0xpZWRMYW5ndWFnZXMiOjAsImhhc0xpZWRSZXNvbHV0aW9uIjowLCJoYXNMaWVkT3MiOjAsImhhc0xpZWRCcm93c2VyIjowLCJmb250cyI6IjI5MmVhMmNjZWNjZDAyYjAxYzBjNGMxZDQxMzIxNzVlIiwiYXVkaW8iOiIzOTRmNjQwMGY0NDg5NDIwNDIzZGYzMzY1OGU1NGJlNiIsImVudW1lcmF0ZURldmljZXMiOiJmMjA4Yzc3MWExNjBiNjRmNDkzOWFmYmE1OTY2YTRhZiJ9fQ==", - "encryptedExpiryMonth": "test_03", - "encryptedExpiryYear": "test_2030", - "encryptedSecurityCodes": { - "unknown": "665", - "matches": "test_001" - }, - "cards": { - "simpleCard": { - "brand": "visa", - "encryptedCardNumber": "test_4111111145551142" - }, - "threeDSecureOneAuth": { - "brand": "visa", - "encryptedCardNumber": "test_4212345678901237" - }, - "threeDSecureTwoAuth": { - "encryptedCardNumber": "test_5454545454545454", - "brand": "mc" - }, - "errorCard": { - "brand": "visa", - "encryptedCardNumber": "test_5201282999005515" - }, - "closeAccount": { - "brand": "visa", - "encryptedCardNumber": "test_5454541580311093" - }, - "avs": { - "brand": "visa", - "encryptedCardNumber": "test_4400000000000008" - } - } - }, - "stripe":{ - "simpleCardNumber": "5555555555554444", - "insufficientFundsCard": "4000000000009995", - "threeDSecureAuthCard": "4000002760003184" - } -} \ No newline at end of file diff --git a/cypress/fixtures/errors/demo/orderDratCreate.js b/cypress/fixtures/errors/demo/orderDratCreate.js deleted file mode 100644 index d69c8f6b4bf..00000000000 --- a/cypress/fixtures/errors/demo/orderDratCreate.js +++ /dev/null @@ -1 +0,0 @@ -export const orderDraftCreateDemoResponse = "API runs in read-only mode!"; diff --git a/cypress/fixtures/images/saleorDemoProductSneakers.png b/cypress/fixtures/images/saleorDemoProductSneakers.png deleted file mode 100644 index c6b3b03867d..00000000000 Binary files a/cypress/fixtures/images/saleorDemoProductSneakers.png and /dev/null differ diff --git a/cypress/fixtures/index.js b/cypress/fixtures/index.js deleted file mode 100644 index 2ff87502639..00000000000 --- a/cypress/fixtures/index.js +++ /dev/null @@ -1,7 +0,0 @@ -export { bodyMockHomePage } from "./bodyMocks"; -export { orderDraftCreateDemoResponse } from "./errors/demo/orderDratCreate"; -export { urlList } from "./urlList"; -export { ONE_PERMISSION_USERS, TEST_ADMIN_USER } from "./users"; -export { MESSAGES } from "./messages"; -export * as LOCAL_STORAGE_FOR_COLUMN_PICKER from "./localStorage/columnPickerMocks"; -export * as LOCAL_STORAGE_KEYS from "./localStorage/keys"; diff --git a/cypress/fixtures/localStorage/columnPickerMocks.js b/cypress/fixtures/localStorage/columnPickerMocks.js deleted file mode 100644 index fdd67b34b20..00000000000 --- a/cypress/fixtures/localStorage/columnPickerMocks.js +++ /dev/null @@ -1,139 +0,0 @@ -export const listConfigWithAttributeColumnPicker = { - APPS_LIST: { - rowNumber: 100, - }, - ATTRIBUTE_VALUE_LIST: { - rowNumber: 10, - }, - CATEGORY_LIST: { - rowNumber: 20, - }, - COLLECTION_LIST: { - rowNumber: 20, - }, - CUSTOMER_LIST: { - rowNumber: 20, - }, - DRAFT_LIST: { - rowNumber: 20, - columns: ["number", "date", "customer", "total"], - }, - NAVIGATION_LIST: { - rowNumber: 20, - }, - ORDER_LIST: { - rowNumber: 20, - columns: ["number", "date", "customer", "payment", "status", "total"], - }, - PAGES_LIST: { - rowNumber: 20, - }, - PLUGIN_LIST: { - rowNumber: 20, - }, - PRODUCT_LIST: { - columns: [ - "name", - "availability", - "description", - "price", - "productType", - "date", - "attribute:QXR0cmlidXRlOjIx", - ], - rowNumber: 20, - }, - SALES_LIST: { - rowNumber: 20, - }, - SHIPPING_METHODS_LIST: { - rowNumber: 20, - }, - STAFF_MEMBERS_LIST: { - rowNumber: 20, - }, - PERMISSION_GROUP_LIST: { - rowNumber: 20, - }, - VOUCHER_LIST: { - rowNumber: 20, - }, - WAREHOUSE_LIST: { - rowNumber: 20, - }, - WEBHOOK_LIST: { - rowNumber: 20, - }, - TRANSLATION_ATTRIBUTE_VALUE_LIST: { - rowNumber: 10, - }, - " GIFT_CARD_LIST": { - rowNumber: 20, - }, -}; - -export const localStorageWithSingleStaticColumn = { - APPS_LIST: { - rowNumber: 100, - }, - ATTRIBUTE_VALUE_LIST: { - rowNumber: 10, - }, - CATEGORY_LIST: { - rowNumber: 20, - }, - COLLECTION_LIST: { - rowNumber: 20, - }, - CUSTOMER_LIST: { - rowNumber: 20, - }, - DRAFT_LIST: { - rowNumber: 20, - columns: ["number", "date", "customer", "total"], - }, - NAVIGATION_LIST: { - rowNumber: 20, - }, - ORDER_LIST: { - rowNumber: 20, - columns: ["number", "date", "customer", "payment", "status", "total"], - }, - PAGES_LIST: { - rowNumber: 20, - }, - PLUGIN_LIST: { - rowNumber: 20, - }, - PRODUCT_LIST: { - columns: ["name"], - rowNumber: 20, - }, - SALES_LIST: { - rowNumber: 20, - }, - SHIPPING_METHODS_LIST: { - rowNumber: 20, - }, - STAFF_MEMBERS_LIST: { - rowNumber: 20, - }, - PERMISSION_GROUP_LIST: { - rowNumber: 20, - }, - VOUCHER_LIST: { - rowNumber: 20, - }, - WAREHOUSE_LIST: { - rowNumber: 20, - }, - WEBHOOK_LIST: { - rowNumber: 20, - }, - TRANSLATION_ATTRIBUTE_VALUE_LIST: { - rowNumber: 10, - }, - " GIFT_CARD_LIST": { - rowNumber: 20, - }, -}; diff --git a/cypress/fixtures/localStorage/keys.js b/cypress/fixtures/localStorage/keys.js deleted file mode 100644 index 0ceb80fe2d3..00000000000 --- a/cypress/fixtures/localStorage/keys.js +++ /dev/null @@ -1,3 +0,0 @@ -export const keys = { - productPresets: "productPresets", -}; diff --git a/cypress/fixtures/messages.js b/cypress/fixtures/messages.js deleted file mode 100644 index 54e4031557d..00000000000 --- a/cypress/fixtures/messages.js +++ /dev/null @@ -1,8 +0,0 @@ -export const MESSAGES = { - noProductFound: "No products found", - confirmProductsDeletion: "Are you sure you want to delete 2 products?", - invalidEmailAddress: "Enter a valid email address.", - slugMustBeUnique: "Slug must be unique", - noGiftCardsFound: "No gift cards found", - noShippingZonesFound: "No shipping zones found", -}; diff --git a/cypress/fixtures/permissions.js b/cypress/fixtures/permissions.js deleted file mode 100644 index c227b07c666..00000000000 --- a/cypress/fixtures/permissions.js +++ /dev/null @@ -1,102 +0,0 @@ -import * as menuSelectors from "../elements/account/left-menu/left-menu-selectors"; -import { CONFIGURATION_SELECTORS } from "../elements/configuration/configuration-selectors"; - -const configurationAsParent = { - parentMenuSelector: menuSelectors.MENU.configuration, - parentSelectors: CONFIGURATION_SELECTORS, -}; - -export const PERMISSIONS = { - channel: { - parent: configurationAsParent, - permissionSelectors: [CONFIGURATION_SELECTORS.channels], - }, - customer: { - permissionSelectors: [menuSelectors.MENU.customers], - }, - discounts: { - parent: { - parentMenuSelector: menuSelectors.MENU.discounts, - parentSelectors: [menuSelectors.DISCOUNTS], - }, - permissionSelectors: [ - menuSelectors.DISCOUNTS.sales, - menuSelectors.DISCOUNTS.vouchers, - ], - }, - order: { - parent: { - parentMenuSelector: menuSelectors.MENU.orders, - parentSelectors: menuSelectors.ORDERS, - }, - permissionSelectors: [ - menuSelectors.ORDERS.orders, - menuSelectors.ORDERS.draftOrders, - ], - }, - page: { - parent: configurationAsParent, - permissionSelectors: [ - CONFIGURATION_SELECTORS.pageTypes, - menuSelectors.MENU.pages, - ], - }, - plugin: { - parent: configurationAsParent, - permissionSelectors: [CONFIGURATION_SELECTORS.plugin], - }, - product: { - parent: { - parentMenuSelector: menuSelectors.MENU.catalog, - parentSelectors: menuSelectors.CATALOG, - }, - permissionSelectors: [ - menuSelectors.CATALOG.categories, - menuSelectors.CATALOG.collections, - menuSelectors.CATALOG.products, - ], - }, - productTypeAndAttribute: { - parent: configurationAsParent, - permissionSelectors: [ - CONFIGURATION_SELECTORS.attributes, - CONFIGURATION_SELECTORS.productTypes, - ], - }, - pageTypeAndAttribute: { - parent: configurationAsParent, - permissionSelectors: [ - CONFIGURATION_SELECTORS.pageTypes, - CONFIGURATION_SELECTORS.attributes, - ], - }, - settings: { - parent: configurationAsParent, - permissionSelectors: [ - CONFIGURATION_SELECTORS.taxes, - CONFIGURATION_SELECTORS.settings, - ], - }, - shipping: { - parent: configurationAsParent, - permissionSelectors: [CONFIGURATION_SELECTORS.shipping], - }, - staff: { - parent: configurationAsParent, - permissionSelectors: [ - CONFIGURATION_SELECTORS.staffMembers, - CONFIGURATION_SELECTORS.permissionGroups, - ], - }, - translations: { - permissionSelectors: [menuSelectors.MENU.translations], - }, - warehouse: { - parent: configurationAsParent, - permissionSelectors: [CONFIGURATION_SELECTORS.warehouse], - }, - taxes: { - parent: configurationAsParent, - permissionSelectors: [CONFIGURATION_SELECTORS.taxes], - }, -}; diff --git a/cypress/fixtures/permissionsUsers.js b/cypress/fixtures/permissionsUsers.js deleted file mode 100644 index 75ae49745df..00000000000 --- a/cypress/fixtures/permissionsUsers.js +++ /dev/null @@ -1,83 +0,0 @@ -import { PERMISSIONS } from "./permissions"; -import { ONE_PERMISSION_USERS } from "./users"; - -export const PERMISSIONS_OPTIONS = { - app: { - user: ONE_PERMISSION_USERS.app, - permissions: [], - testCase: "TC: SALEOR_3402", - }, - channel: { - user: ONE_PERMISSION_USERS.channel, - permissions: [PERMISSIONS.channel, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3403", - }, - customer: { - user: ONE_PERMISSION_USERS.user, - permissions: [PERMISSIONS.customer], - testCase: "TC: SALEOR_3404", - }, - discount: { - user: ONE_PERMISSION_USERS.discount, - permissions: [PERMISSIONS.discounts], - testCase: "TC: SALEOR_3405", - }, - giftCard: { - user: ONE_PERMISSION_USERS.giftCard, - testCase: "TC: SALEOR_3406", - }, - order: { - user: ONE_PERMISSION_USERS.order, - permissions: [PERMISSIONS.order], - testCase: "TC: SALEOR_3407", - }, - page: { - user: ONE_PERMISSION_USERS.page, - permissions: [PERMISSIONS.page, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3408", - }, - plugin: { - user: ONE_PERMISSION_USERS.plugin, - permissions: [PERMISSIONS.plugin, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3409", - }, - product: { - user: ONE_PERMISSION_USERS.product, - permissions: [ - PERMISSIONS.product, - PERMISSIONS.warehouse, - PERMISSIONS.taxes, - ], - testCase: "TC: SALEOR_3410", - }, - productTypeAndAttribute: { - user: ONE_PERMISSION_USERS.productTypeAndAttribute, - permissions: [PERMISSIONS.productTypeAndAttribute, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3411", - }, - pageTypeAndAttribute: { - user: ONE_PERMISSION_USERS.pageTypeAndAttribute, - permissions: [PERMISSIONS.pageTypeAndAttribute, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3412", - }, - settings: { - user: ONE_PERMISSION_USERS.settings, - permissions: [PERMISSIONS.settings, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3413", - }, - staff: { - user: ONE_PERMISSION_USERS.staff, - permissions: [PERMISSIONS.staff, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3414", - }, - shipping: { - user: ONE_PERMISSION_USERS.shipping, - permissions: [PERMISSIONS.shipping, PERMISSIONS.taxes], - testCase: "TC: SALEOR_3415", - }, - translations: { - user: ONE_PERMISSION_USERS.translations, - permissions: [PERMISSIONS.translations], - testCase: "TC: SALEOR_3416", - }, -}; diff --git a/cypress/fixtures/products.js b/cypress/fixtures/products.js deleted file mode 100644 index ced115a796f..00000000000 --- a/cypress/fixtures/products.js +++ /dev/null @@ -1,3 +0,0 @@ -export const demoProductsNames = { - carrotJuice: "Carrot Juice" -}; diff --git a/cypress/fixtures/urlList.js b/cypress/fixtures/urlList.js deleted file mode 100644 index 12587cbac2f..00000000000 --- a/cypress/fixtures/urlList.js +++ /dev/null @@ -1,98 +0,0 @@ -export const urlList = { - apiUri: Cypress.env("API_URL"), - dashboard: "dashboard/", - addProduct: "products/add", - apps: "custom-apps/", - attributes: "attributes/", - channels: "channels/", - categories: "categories/", - collections: "collections/", - configuration: "configuration/", - customers: "customers/", - draftOrders: "orders/drafts/", - giftCards: "gift-cards/", - homePage: "/", - newPassword: "new-password/", - navigation: "navigation/", - orders: "orders/", - pages: "pages/", - addPageType: "pages/add?page-type-id=", - pageTypes: "page-types/", - permissionsGroups: "permission-groups/", - plugins: "plugins/", - products: "products/", - productTypes: "product-types/", - sales: "discounts/sales/", - shippingMethods: "shipping/", - siteSettings: "site-settings/", - staffMembers: "staff/", - stripeApiPaymentMethods: "https://api.stripe.com/v1/payment_methods", - translations: "translations/", - variants: "variant/", - vouchers: "discounts/vouchers/", - variant: "variant/", - warehouses: "warehouses/", - webhooksAndEvents: "custom-apps/", -}; - -export const addVariantUrl = productId => - `${urlList.products}${productId}/${urlList.variants}add`; - -export const appDetailsUrl = appId => `${urlList.webhooksAndEvents}${appId}`; - -export const attributeDetailsUrl = attributeId => - `${urlList.attributes}${attributeId}`; - -export const categoryDetailsUrl = categoryId => - `${urlList.categories}${categoryId}`; - -export const collectionDetailsUrl = collectionId => - `${urlList.collections}${collectionId}`; - -export const customerDetailsUrl = customerId => - `${urlList.customers}${customerId}`; - -export const giftCardDetailsUrl = giftCardId => - `${urlList.giftCards}${giftCardId}`; - -export const menuDetailsUrl = menuId => `${urlList.navigation}${menuId}`; - -export const pageDetailsUrl = pageId => `${urlList.pages}${pageId}`; - -export const pageTypeDetailsUrl = pageTypeId => - `${urlList.pageTypes}${pageTypeId}`; - -export const permissionGroupDetails = permissionGroupId => - `${urlList.permissionsGroups}${permissionGroupId}`; - -export const productDetailsUrl = productId => `${urlList.products}${productId}`; - -export const productVariantDetailUrl = (productId, variantId) => - `${urlList.products}${productId}/${urlList.variants}${variantId}`; - -export const productTypeDetailsUrl = productTypeId => - `${urlList.productTypes}${productTypeId}`; - -export const staffMemberDetailsUrl = staffMemberId => - `${urlList.staffMembers}${staffMemberId}`; - -export const shippingZoneDetailsUrl = shippingZoneId => - `${urlList.shippingMethods}${shippingZoneId}`; - -export const userDetailsUrl = userId => `${urlList.staffMembers}${userId}`; - -export const shippingRateUrl = (shippingZoneId, weightRateId) => - `${urlList.shippingMethods}${shippingZoneId}/${weightRateId}`; - -export const warehouseDetailsUrl = warehouseId => - `${urlList.warehouses}${warehouseId}`; - -export const saleDetailsUrl = saleId => `${urlList.sales}${saleId}`; - -export const variantDetailsUrl = (productId, variantId) => - `${urlList.products}${productId}/${urlList.variants}${variantId}`; - -export const voucherDetailsUrl = voucherId => `${urlList.vouchers}${voucherId}`; - -export const stripeConfirmationUrl = id => - `https://api.stripe.com/v1/payment_intents/${id}/confirm`; diff --git a/cypress/fixtures/users.js b/cypress/fixtures/users.js deleted file mode 100644 index 910d4bdda27..00000000000 --- a/cypress/fixtures/users.js +++ /dev/null @@ -1,35 +0,0 @@ -export const TEST_ADMIN_USER = { - email: Cypress.env("USER_NAME"), - password: Cypress.env("USER_PASSWORD"), - name: "Test", - lastName: "Test" -}; -export const USER_WITHOUT_NAME = { - email: Cypress.env("SECOND_USER_NAME"), - password: Cypress.env("USER_PASSWORD") -}; -export const ONE_PERMISSION_USERS = { - channel: getOnePermissionUser("channel.manager@example.com"), - shipping: getOnePermissionUser("shipping.manager@example.com"), - giftCard: getOnePermissionUser("gift.card.manager@example.com"), - app: getOnePermissionUser("app.manager@example.com"), - settings: getOnePermissionUser("setting.manager@example.com"), - page: getOnePermissionUser("page.manager@example.com"), - order: getOnePermissionUser("order.manager@example.com"), - translations: getOnePermissionUser("translation.manager@example.com"), - menu: getOnePermissionUser("menu.manager@example.com"), - staff: getOnePermissionUser("staff.manager@example.com"), - user: getOnePermissionUser("user.manager@example.com"), - pageTypeAndAttribute: getOnePermissionUser( - "page.type.and.attribute.manager@example.com" - ), - productTypeAndAttribute: getOnePermissionUser( - "product.type.and.attribute.manager@example.com" - ), - discount: getOnePermissionUser("discount.manager@example.com"), - plugin: getOnePermissionUser("plugin.manager@example.com"), - product: getOnePermissionUser("product.manager@example.com") -}; -function getOnePermissionUser(email) { - return { email, password: Cypress.env("PERMISSIONS_USERS_PASSWORD") }; -} diff --git a/cypress/fixtures/weightsUnits.js b/cypress/fixtures/weightsUnits.js deleted file mode 100644 index 5ba6a39fa60..00000000000 --- a/cypress/fixtures/weightsUnits.js +++ /dev/null @@ -1 +0,0 @@ -export const WEIGHT_UNITS = ["KG", "G", "LB", "OZ", "TONNE"]; diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js deleted file mode 100644 index 5742f42ed2b..00000000000 --- a/cypress/plugins/index.js +++ /dev/null @@ -1,80 +0,0 @@ -// / -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ - -/* eslint-disable @typescript-eslint/no-var-requires */ - -const graphql = require("graphql-request"); - -module.exports = async (on, config) => { - // require("cypress-mochawesome-reporter/plugin")(on); - - require("dotenv").config(); - - config.env.API_URL = process.env.API_URL; - config.env.APP_MOUNT_URI = process.env.APP_MOUNT_URI; - config.env.SHOP = await getShopInfo(process.env); - config.env.STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY; - config.env.STRIPE_PUBLIC_KEY = process.env.STRIPE_PUBLIC_KEY; - config.env.USER_NAME = process.env.CYPRESS_USER_NAME; - config.env.USER_PASSWORD = process.env.CYPRESS_USER_PASSWORD; - config.env.SECOND_USER_NAME = process.env.CYPRESS_SECOND_USER_NAME; - config.env.PERMISSIONS_USERS_PASSWORD = - process.env.CYPRESS_PERMISSIONS_USERS_PASSWORD; - config.env.MAILPITURL = process.env.CYPRESS_MAILPITURL; - config.env.grepTags = process.env.CYPRESS_grepTags; - config.baseUrl = process.env.BASE_URL; - config.env.LOCALE_CODE = process.env.LOCALE_CODE; - - on("before:browser:launch", (_browser = {}, launchOptions) => { - launchOptions.args.push("--proxy-bypass-list=<-loopback>"); - return launchOptions; - }); - - return config; -}; - -function getShopInfo(envVariables) { - const createTokenMutation = graphql.gql`mutation tokenCreate($email: String!, $password: String!){ - tokenCreate(email:$email, password:$password){ - token - } - }`; - - const getShopInfoQuery = graphql.gql`query{ - shop{ - version - } - }`; - - const client = new graphql.GraphQLClient(envVariables.API_URL, { - headers: {}, - }); - - return client - .request(createTokenMutation, { - email: envVariables.CYPRESS_USER_NAME, - password: envVariables.CYPRESS_USER_PASSWORD, - }) - .then(data => { - const token = data.tokenCreate.token; - client.setHeader("Authorization", `JWT ${token}`); - return client - .request(getShopInfoQuery) - .then(shopInfo => shopInfo.shop.version); - }); -} diff --git a/cypress/support/api/requests/Apps.js b/cypress/support/api/requests/Apps.js deleted file mode 100644 index ff962c1c7e7..00000000000 --- a/cypress/support/api/requests/Apps.js +++ /dev/null @@ -1,79 +0,0 @@ -export function createApp(name, permission) { - const mutation = `mutation{ - appCreate(input:{name:"${name}" permissions:${permission}}){ - authToken - errors{ - field - message - } - app{ - id - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.appCreate"); -} - -export function getApps(first, search) { - const mutation = `query{ - apps(filter:{ search: "${search}"} first: ${first}){ - edges{ - node{ - name - id - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .then(resp => resp.body.data.apps.edges); -} - -export function deleteApp(appId) { - const mutation = `mutation{ - appDelete(id:"${appId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getApp(appId) { - const query = `query{ - app(id:"${appId}"){ - name - permissions{ - code - } - tokens{ - name - authToken - } - webhooks{ - name - targetUrl - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.app"); -} - -export function updateApp(appId, permission) { - const mutation = `mutation{ - appUpdate(id:"${appId}" input:{permissions: [${permission}]}){ - errors{ - code - } - app{ - permissions{ - name - } - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Attribute.js b/cypress/support/api/requests/Attribute.js deleted file mode 100644 index af5c3e6894b..00000000000 --- a/cypress/support/api/requests/Attribute.js +++ /dev/null @@ -1,121 +0,0 @@ -export function createAttribute({ - name, - attributeValues = ["value"], - type = "PRODUCT_TYPE", - inputType = "DROPDOWN", - filterableInDashboard = false, - values = [], -}) { - if ( - inputType === "MULTISELECT" || - inputType === "DROPDOWN" || - inputType === "SWATCH" - ) { - values = attributeValues.map(element => `{name:"${element}"}`); - } - const mutation = `mutation{ - attributeCreate(input:{ - name:"${name}" - valueRequired:false - type:${type} - values: [${values}] - inputType: ${inputType} - filterableInDashboard: ${filterableInDashboard} - }){ - attribute{ - id - name - slug - choices(first: 100){ - edges{ - node{ - name - } - } - } - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.attributeCreate.attribute"); -} - -export function getAttributes(first, search) { - const mutation = `query{ - attributes(first:${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .then(resp => resp.body.data.attributes.edges); -} - -export function deleteAttribute(attributeId) { - const mutation = `mutation{ - attributeDelete(id:"${attributeId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getAttribute(attributeId) { - const query = `query{ - attribute(id:"${attributeId}"){ - id - inputType - name - slug - type - entityType - valueRequired - visibleInStorefront - availableInGrid - unit - choices(first: 100){ - edges{ - node{ - file{ - contentType - } - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.attribute"); -} - -export function updateAttribute({ attributeId, filterableInDashboard }) { - const mutation = `mutation{ - attributeUpdate(id:"${attributeId}" input:{ - filterableInDashboard: ${filterableInDashboard} - }){ - attribute{ - id - filterableInDashboard - } - errors{ - field - message - } - } -}`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Category.js b/cypress/support/api/requests/Category.js deleted file mode 100644 index a25ea009a55..00000000000 --- a/cypress/support/api/requests/Category.js +++ /dev/null @@ -1,120 +0,0 @@ -import { - getDataForDescriptionInVariables, - getValueWithDefault -} from "./utils/Utils"; - -export function createCategory({ name, slug = name, parent }) { - const parentLine = getValueWithDefault(parent, `parent:"${parent}"`); - const mutation = `mutation{ - categoryCreate(input:{name:"${name}", slug: "${slug}"} ${parentLine}){ - errors{ - field - message - } - category{ - id - name - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.categoryCreate.category"); -} - -export function getCategory(categoryId, translationLanguageCode) { - const translation = getValueWithDefault( - translationLanguageCode, - `translation(languageCode:${translationLanguageCode}){ - name - description - seoTitle - seoDescription - }` - ); - - const mutation = `query{ - category(id:"${categoryId}"){ - name - description - products(first:100){ - edges{ - node{ - name - } - } - } - children(first:100){ - edges{ - node{ - name - } - } - } - ${translation} - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.category"); -} - -export function getCategories(first, search) { - const mutation = `query{ - categories(first:${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .then(resp => resp.body.data.categories.edges); -} - -export function deleteCategory(categoryId) { - const mutation = `mutation{ - categoryDelete(id:"${categoryId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function updateCategoryTranslation({ - categoryTranslateId, - languageCode, - seoTitle, - seoDescription, - name, - description -}) { - const descriptionData = getDataForDescriptionInVariables(description); - const mutation = `mutation Update_fields${descriptionData.mutationVariables}{ - categoryTranslate (id:"${categoryTranslateId}",languageCode:${languageCode},input:{ - seoTitle:"${seoTitle}", - seoDescription:"${seoDescription}", - name:"${name}" - ${descriptionData.descriptionLine} - }) - { - errors{ - field - message - } - } - } - `; - return cy.sendRequestWithQuery( - mutation, - "auth", - descriptionData.variables, - true - ); -} diff --git a/cypress/support/api/requests/Channels.js b/cypress/support/api/requests/Channels.js deleted file mode 100644 index 54aa022fe86..00000000000 --- a/cypress/support/api/requests/Channels.js +++ /dev/null @@ -1,121 +0,0 @@ -export function createChannel({ - isActive = true, - name, - slug = name, - currencyCode = "PLN", - defaultCountry = "PL", -}) { - const createChannelMutation = `mutation{ - channelCreate(input: { - isActive: ${isActive} - name: "${name}" - slug: "${slug}" - currencyCode: "${currencyCode}" - defaultCountry: ${defaultCountry} - }){ - channel{ - id - name - slug - } - errors{ - code - message - } - } - }`; - return cy - .sendRequestWithQuery(createChannelMutation) - .its("body.data.channelCreate.channel"); -} - -export function getChannels() { - const getChannelsInfoQuery = `query{ - channels{ - name - id - isActive - slug - currencyCode - } - }`; - return cy.sendRequestWithQuery(getChannelsInfoQuery); -} - -export function deleteChannel(channelId, targetChannelId) { - const deleteChannelMutation = `mutation{ - channelDelete(id: "${channelId}", input:{ - channelId: "${targetChannelId}" - }){ - channel{ - name - } - errors{ - message - } - } - }`; - return cy.sendRequestWithQuery(deleteChannelMutation); -} - -export function activateChannel(channelId) { - const mutation = `mutation{ - channelActivate(id:"${channelId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function updateChannelWarehouses(channelId, warehouseId) { - const mutation = `mutation{ - channelUpdate(id:"${channelId}", input:{ - addWarehouses:"${warehouseId}" - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function updateChannelOrderSettings({ - channelId, - automaticallyConfirmAllNewOrders = true, - automaticallyFulfillNonShippableGiftCard = true, - expireOrdersAfter = 0, - markAsPaidStrategy = "PAYMENT_FLOW", // TRANSACTION_FLOW - creates the TransactionItem object. - defaultTransactionFlowStrategy = "AUTHORIZATION", -}) { - const mutation = `mutation{ - channelUpdate(id:"${channelId}", input: {orderSettings: { - automaticallyConfirmAllNewOrders: ${automaticallyConfirmAllNewOrders}, - automaticallyFulfillNonShippableGiftCard: ${automaticallyFulfillNonShippableGiftCard}, - expireOrdersAfter: ${expireOrdersAfter}, - markAsPaidStrategy: ${markAsPaidStrategy}, - }paymentSettings:{ defaultTransactionFlowStrategy: ${defaultTransactionFlowStrategy} - }}){ - errors{ - field - message - } - channel { - orderSettings{ - automaticallyConfirmAllNewOrders - automaticallyFulfillNonShippableGiftCard - expireOrdersAfter - markAsPaidStrategy - } - paymentSettings { - defaultTransactionFlowStrategy - } - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Checkout.js b/cypress/support/api/requests/Checkout.js deleted file mode 100644 index 4266824c3f6..00000000000 --- a/cypress/support/api/requests/Checkout.js +++ /dev/null @@ -1,303 +0,0 @@ -import { - getDefaultAddress, - getPaymentDataLine, - getValueWithDefault, - getVariantsLines, -} from "./utils/Utils"; - -export function createCheckout({ - channelSlug, - email, - productQuantity = 1, - variantsList, - address, - billingAddress, - auth = "auth", - returnAvailableCollectionPoints = false, -}) { - const lines = getVariantsLines(variantsList, productQuantity); - const shippingAddress = getDefaultAddress(address, "shippingAddress"); - const billingAddressLines = getDefaultAddress( - billingAddress, - "billingAddress", - ); - - const availableCollectionPointsLines = getValueWithDefault( - returnAvailableCollectionPoints, - `availableCollectionPoints{ - id - name - clickAndCollectOption - isPrivate - }`, - ); - - const emailLine = getValueWithDefault(email, `email: "${email}"`); - const mutation = `mutation{ - checkoutCreate(input:{ - channel:"${channelSlug}" - ${emailLine} - lines: [${lines.join()}] - ${shippingAddress} - ${billingAddressLines} - }){ - errors{ - field - message - } - created - checkout{ - token - id - token - shippingMethods{ - name - id - } - lines{ - variant{ - id - pricing{ - onSale - price{ - gross{ - amount - } - } - } - } - } - ${availableCollectionPointsLines} - } - } - }`; - return cy - .sendRequestWithQuery(mutation, auth) - .its("body.data.checkoutCreate"); -} - -export function addShippingMethod(checkoutId, shippingMethodId) { - const mutation = `mutation{ - checkoutShippingMethodUpdate(checkoutId:"${checkoutId}", - shippingMethodId:"${shippingMethodId}"){ - errors{ - message - field - } - checkout{ - id - shippingMethod{ - id - name - } - totalPrice{ - gross{ - amount - } - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.checkoutShippingMethodUpdate"); -} - -export function deliveryMethodUpdate(deliveryMethodId, checkoutToken) { - const mutation = `mutation{ - checkoutDeliveryMethodUpdate(deliveryMethodId:"${deliveryMethodId}", token:"${checkoutToken}"){ - errors{ - field - message - } - } - }`; - cy.sendRequestWithQuery(mutation); -} - -export function addPayment({ checkoutId, gateway, token, amount }) { - const tokenLine = getValueWithDefault(token, `token:"${token}"`); - const amountLine = getValueWithDefault(amount, `amount: ${amount}`); - const mutation = `mutation{ - checkoutPaymentCreate(checkoutId:"${checkoutId}", - input:{ - gateway: "${gateway}" - ${tokenLine} - ${amountLine} - }){ - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.checkoutPaymentCreate"); -} - -export function completeCheckout(checkoutId, paymentData) { - const paymentDataLine = getPaymentDataLine(paymentData); - const mutation = `mutation{ - checkoutComplete(checkoutId:"${checkoutId}" ${paymentDataLine}){ - order{ - userEmail - id - lines{ - id - } - paymentStatus - total{ - gross{ - amount - } - } - } - confirmationNeeded - confirmationData - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.checkoutComplete"); -} - -export function addVoucher(checkoutId, voucherCode) { - const mutation = `mutation addVoucher{ - checkoutAddPromoCode(checkoutId:"${checkoutId}", - promoCode:"${voucherCode}" - ){ - errors{ - field - message - } - checkout{ - id - totalPrice{ - gross{ - amount - } - } - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function checkoutVariantsUpdate(checkoutId, variantsList) { - const lines = getVariantsLines(variantsList, 1); - const mutation = `mutation{ - checkoutLinesUpdate(checkoutId:"${checkoutId}", - lines: [${lines.join()}]){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function checkoutShippingMethodUpdate(checkoutId, shippingMethodId) { - const mutation = `mutation{ - checkoutShippingMethodUpdate(checkoutId:"${checkoutId}" shippingMethodId:"${shippingMethodId}"){ - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.checkoutShippingMethodUpdate"); -} - -export function checkoutShippingAddressUpdate(checkoutId, address) { - const shippingAddress = getDefaultAddress(address, "shippingAddress"); - const mutation = `mutation{ - checkoutShippingAddressUpdate(checkoutId:"${checkoutId}", - ${shippingAddress} - ){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addProductsToCheckout( - checkoutId, - variantsList, - productQuantity, -) { - const lines = getVariantsLines(variantsList, productQuantity); - const mutation = `mutation{ - checkoutLinesUpdate(checkoutId:"${checkoutId}" lines:[${lines.join()}]){ - checkout{ - id - shippingMethods{ - name - } - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.checkoutLinesUpdate"); -} - -export function getCheckout(token) { - const query = `query{ - checkout(token:"${token}"){ - token - id - token - shippingMethods{ - name - id - } - lines{ - variant{ - id - pricing{ - onSale - price{ - gross{ - amount - } - } - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.checkout"); -} - -export function orderCreateFromCheckout( - checkoutId, - token, - removeCheckoutFlag = true, -) { - const mutation = `mutation { - orderCreateFromCheckout(id: "${checkoutId}", removeCheckout: ${removeCheckoutFlag}) - { - order{ - id - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation, token) - .its("body.data.orderCreateFromCheckout.order"); -} diff --git a/cypress/support/api/requests/Collections.js b/cypress/support/api/requests/Collections.js deleted file mode 100644 index bf7ac23b75a..00000000000 --- a/cypress/support/api/requests/Collections.js +++ /dev/null @@ -1,104 +0,0 @@ -export function createCollection(name, slug = name) { - const mutation = `mutation { - collectionCreate(input:{ - name:"${name}", - slug:"${name}" - }){ - errors{ - field - message - } - collection{ - name - id - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.collectionCreate.collection"); -} - -export function getCollections(first, search) { - const filter = search - ? `, filter:{ - search:"${search}" - }` - : ""; - const query = `query{ - collections(first:${first} ${filter}){ - edges{ - node{ - id - name - slug - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.collections.edges); -} -export function deleteCollection(collectionId) { - const mutation = `mutation{ - collectionDelete(id:"${collectionId}"){ - collection{ - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addProductToCollection({ collectionId, productId }) { - const mutation = `mutation addProduct { - collectionAddProducts( - collectionId: "${collectionId}" - products: ["${productId}"] - ) { - collection{ - products(first:100){ - totalCount - edges{ - node{ - id - name - } - } - } - } - errors { - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addChannelToCollection({ - collectionId, - channelId, - isPublished = true, -}) { - const mutation = `mutation collectionChannelListingUpdate { - collectionChannelListingUpdate( - id: "${collectionId}", - input: { - addChannels: { - channelId: "${channelId}" - isPublished: ${isPublished} - } - }) { - errors { - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Customer.js b/cypress/support/api/requests/Customer.js deleted file mode 100644 index f51faba36a2..00000000000 --- a/cypress/support/api/requests/Customer.js +++ /dev/null @@ -1,178 +0,0 @@ -import { - getDefaultAddress, - getDefaultAddressWithoutType, - getValueWithDefault, -} from "./utils/Utils"; - -export function createCustomer(email, customerName, address, isActive = false) { - const addressesLines = getValueWithDefault( - address, - `${getDefaultAddress(address, "defaultBillingAddress")} - ${getDefaultAddress(address, "defaultShippingAddress")}`, - ); - const mutation = ` - mutation{ - customerCreate(input:{ - firstName: "${customerName}" - lastName: "${customerName}" - email: "${email}" - isActive: ${isActive} - ${addressesLines} - }){ - user{ - id - email - } - errors{ - code - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.customerCreate"); -} - -export function deleteCustomersStartsWith(startsWith) { - const serverStoredEmail = startsWith.toLowerCase(); - - getCustomers(serverStoredEmail).then(resp => { - if (resp.body.data.customers) { - const customers = resp.body.data.customers.edges; - customers.forEach(element => { - if (element.node.email.includes(serverStoredEmail)) { - deleteCustomer(element.node.id); - } - }); - } - }); -} - -export function deleteCustomer(customerId) { - const mutation = `mutation{ - customerDelete(id:"${customerId}"){ - errors{ - code - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getCustomers(startsWith) { - const query = `query{ - customers(first:100, filter: { - search: "${startsWith}" - }){ - edges{ - node{ - id - email - } - } - } - }`; - return cy.sendRequestWithQuery(query); -} - -export function customerRegistration({ - email, - password = Cypress.env("USER_PASSWORD"), - channel, -}) { - const mutation = `mutation{ - accountRegister(input:{ - email:"${email}", - password:"${password}" - channel:"${channel}" - redirectUrl: "${Cypress.config().baseUrl}account-confirm" - }){ - requiresConfirmation - user{ - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.accountRegister"); -} - -export function requestPasswordReset(email, channel) { - const mutation = `mutation{ - requestPasswordReset(channel:"${channel}" email:"${email}", redirectUrl:"${ - Cypress.config().baseUrl - }password-reset"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function confirmAccount(email, token) { - const serverStoredEmail = email.toLowerCase(); - - const mutation = `mutation{ - confirmAccount(email:"${serverStoredEmail}", token:"${token}"){ - user{ - email - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.confirmAccount"); -} - -export function getCustomer(customerId) { - const query = `query{ - user(id:"${customerId}"){ - id - email - firstName - lastName - isStaff - isActive - note - addresses{ - firstName - lastName - companyName - streetAddress1 - streetAddress2 - city - cityArea - postalCode - country{ - code - } - countryArea - phone - isDefaultShippingAddress - isDefaultBillingAddress - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.user"); -} - -export function addressCreate(userId, address) { - const mutation = `mutation{ - addressCreate(userId:"${userId}" input:{ - ${getDefaultAddressWithoutType(address)} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Discounts/Sales.js b/cypress/support/api/requests/Discounts/Sales.js deleted file mode 100644 index 560308ceba2..00000000000 --- a/cypress/support/api/requests/Discounts/Sales.js +++ /dev/null @@ -1,100 +0,0 @@ -import { - getValuesInArray, - getValueWithDefault, - getVariantsIdsLines -} from "../utils/Utils"; - -export function getSales(first, searchQuery) { - const filter = getValueWithDefault( - searchQuery, - `, filter:{ - search:"${searchQuery}" - }` - ); - const query = `query{ - sales(first: - ${first} ${filter}){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.sales.edges); -} -export function deleteSale(saleId) { - const mutation = `mutation{ - saleDelete(id:"${saleId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function createSale({ name, type, value, products, variants }) { - const productsLine = getValueWithDefault(products, `products: ${products}`); - const variantsLine = getValueWithDefault(variants, `variants: ${variants}`); - const mutation = `mutation{ - saleCreate(input:{ - name: "${name}" - type: ${type} - value: ${value} - ${productsLine} - ${variantsLine} - }){ - sale{ - id - name - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.saleCreate.sale"); -} - -export function updateSale({ saleId, variants, productId }) { - const productsLine = getValueWithDefault( - productId, - `products: [${productId}]` - ); - const variantsLines = getValueWithDefault( - variants, - getValuesInArray(getVariantsIdsLines(variants)), - "[]" - ); - const mutation = `mutation{ - saleUpdate(id:"${saleId}" input:{ - ${productsLine} - variants: ${variantsLines} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addChannelToSale(saleId, channelId, discountValue) { - const mutation = `mutation{ - saleChannelListingUpdate(id:"${saleId}" input:{ - addChannels: [{ - channelId: "${channelId}" - discountValue: "${discountValue}" - }] - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Discounts/Vouchers.js b/cypress/support/api/requests/Discounts/Vouchers.js deleted file mode 100644 index 08d945aa9c9..00000000000 --- a/cypress/support/api/requests/Discounts/Vouchers.js +++ /dev/null @@ -1,80 +0,0 @@ -import { getValueWithDefault } from "../utils/Utils"; - -export function getVouchers(first, startsWith) { - const query = `query getVouchers{ - vouchers(first:${first}, filter:{ - search:"${startsWith}" - }){ - edges{ - node{ - id - code - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.vouchers.edges); -} - -export function deleteVouchers(voucherId) { - const mutation = `mutation deleteVouchers{ - voucherDelete(id:"${voucherId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function createVoucher( - { name, productId, code = name, type, country }, - token, -) { - const discountTypeLines = getValueWithDefault(type, `type:${type}`); - const countryLine = getValueWithDefault(country, `countries:["${country}"]`); - - const mutation = `mutation{ - voucherCreate(input:{ - ${discountTypeLines} - ${countryLine} - name:"${name}", - code:"${code}" - products:["${productId}"] - }){ - voucher{ - id - code - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation, token).its("body.data"); -} - -export function addChannelToVoucher(voucherId, channelId, value) { - const mutation = `mutation{ - voucherChannelListingUpdate(id:"${voucherId}" input:{ - addChannels:{ - channelId:"${channelId}" - discountValue:"${value}" - } - }){ - voucher{ - id - code - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data"); -} diff --git a/cypress/support/api/requests/GiftCard.js b/cypress/support/api/requests/GiftCard.js deleted file mode 100644 index 74910d4abbb..00000000000 --- a/cypress/support/api/requests/GiftCard.js +++ /dev/null @@ -1,176 +0,0 @@ -import { getValueWithDefault } from "./utils/Utils"; - -export function getGiftCardWithTag(tag, withCode = false) { - return getGiftCardsWithTag(1, tag, withCode) - .its("body.data.giftCards.edges") - .its(0) - .its("node"); -} - -export function getGiftCardsWithTag(first, tag, withCode = false) { - const codeLine = getValueWithDefault(withCode, `code`); - const query = `query{ - giftCards(first: ${first}, filter: { code:"", tags: ["${tag}"]}){ - edges{ - node{ - ${codeLine} - displayCode - id - isActive - expiryDate - currentBalance{ - currency - amount - } - initialBalance{ - currency - amount - } - } - } - } - }`; - return cy.sendRequestWithQuery(query); -} - -export function getGiftCards(first) { - const query = `query{ - giftCards(first: ${first}){ - edges{ - node{ - displayCode - id - code - isActive - expiryDate - tags{ - name - } - currentBalance{ - currency - amount - } - initialBalance{ - currency - amount - } - } - } - } - }`; - return cy.sendRequestWithQuery(query); -} - -export function getGiftCardsWithCode(code) { - const query = `query{ - giftCards(first:100, filter: { code: "${code}"}){ - edges{ - node{ - code - displayCode - id - isActive - expiryDate - currentBalance{ - currency - amount - } - initialBalance{ - currency - amount - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.giftCards.edges"); -} - -export function getGiftCardWithId(id) { - const query = `query{ - giftCard(id:"${id}"){ - isActive - expiryDate - tags{ - id - name - } - currentBalance{ - currency - amount - } - initialBalance{ - currency - amount - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.giftCard"); -} - -export function createGiftCard( - { tag, currency, amount, isActive = true }, - token, -) { - const mutation = `mutation{ - giftCardCreate(input:{ - addTags:"${tag}" - isActive: ${isActive} - balance: { - currency: "${currency}" - amount: ${amount} - } - }){ - errors{ - field - message - } - giftCard{ - code - id - isActive - } - } - }`; - return cy - .sendRequestWithQuery(mutation, token) - .its("body.data.giftCardCreate.giftCard"); -} - -export function giftCardDeactivate(giftCardId) { - const mutation = `mutation{ - giftCardDeactivate(id:"${giftCardId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function deleteGiftCard(giftCardId) { - const mutation = `mutation{ - giftCardDelete(id:"${giftCardId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} -export function ensureGiftCardIsCreated(giftCardId, retries = 0) { - return getGiftCards(100, giftCardId).then(giftCardsListResponse => { - if (JSON.stringify(giftCardsListResponse).includes(giftCardId)) { - return; - } else if (retries > 4) { - throw new Error( - `Gift card with id: ${giftCardId} should be on list but could not find it. Retried for ${retries} times`, - ); - } else { - cy.wait(5000); - ensureGiftCardIsAdded(giftCardId, retries + 1); - } - }); -} diff --git a/cypress/support/api/requests/HomePage.js b/cypress/support/api/requests/HomePage.js deleted file mode 100644 index cb5e5a82431..00000000000 --- a/cypress/support/api/requests/HomePage.js +++ /dev/null @@ -1,34 +0,0 @@ -export function getSalesForChannel(channelSlug, period) { - const query = `query{ - ordersTotal(period: ${period}, channel:"${channelSlug}"){ - gross{ - amount - } - } - }`; - return cy.sendRequestWithQuery(query); -} -export function getOrdersForChannel(channelSlug, { gte, lte }) { - const query = `query{ - orders(filter: { created: { gte: "${gte}", lte: "${lte}" } }, channel:"${channelSlug}"){ - totalCount - } - }`; - return cy.sendRequestWithQuery(query); -} -export function getOrdersWithStatus(status, channelSlug) { - const query = `query{ - orders(filter: { status: ${status} }, channel:"${channelSlug}"){ - totalCount - } - }`; - return cy.sendRequestWithQuery(query); -} -export function getProductsOutOfStock(channelSlug) { - const query = `query{ - products(filter: { stockAvailability: OUT_OF_STOCK} channel:"${channelSlug}" ){ - totalCount - } - }`; - return cy.sendRequestWithQuery(query); -} diff --git a/cypress/support/api/requests/Menu.js b/cypress/support/api/requests/Menu.js deleted file mode 100644 index 0c2b63afb44..00000000000 --- a/cypress/support/api/requests/Menu.js +++ /dev/null @@ -1,68 +0,0 @@ -export function getMenu(menuId) { - const query = `query{ - menu(id:"${menuId}"){ - id - name - items{ - name - category{ - name - } - collection{ - name - } - page{ - title - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.menu"); -} - -export function getMenus(first, search) { - const mutation = `query{ - menus(first:${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .then(resp => resp.body.data.menus.edges); -} - -export function deleteMenu(menuId) { - const mutation = `mutation{ - menuDelete(id:"${menuId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function createMenu(name) { - const mutation = `mutation{ - menuCreate(input:{ - name:"${name}" - }){ - errors{ - field - message - } - menu{ - id - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.menuCreate"); -} diff --git a/cypress/support/api/requests/Metadata.js b/cypress/support/api/requests/Metadata.js deleted file mode 100644 index e5776b03249..00000000000 --- a/cypress/support/api/requests/Metadata.js +++ /dev/null @@ -1,31 +0,0 @@ -export function updateMetadata(id, key, value) { - const mutation = `mutation{ - updateMetadata(id:"${id}" input:{ - key:"${key}", - value:"${value}" - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.updateMetadata"); -} - -export function updatePrivateMetadata(token, key, value) { - const mutation = `mutation{ - updatePrivateMetadata(id:"${token}" input:{ - key:"${key}", - value:"${value}" - }){ - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.updatePrivateMetadata"); -} diff --git a/cypress/support/api/requests/Order.js b/cypress/support/api/requests/Order.js deleted file mode 100644 index 3cb1f79c04a..00000000000 --- a/cypress/support/api/requests/Order.js +++ /dev/null @@ -1,248 +0,0 @@ -import { getDefaultAddress, getValueWithDefault } from "./utils/Utils"; - -export function markOrderAsPaid(orderId) { - const mutation = `mutation{ - orderMarkAsPaid(id:"${orderId}"){ - errors{ - message - } - order{ - id - number - lines{ - id - } - total{ - gross{ - amount - currency - } - } - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.orderMarkAsPaid"); -} - -export function updateOrdersSettings(automaticallyConfirmAllNewOrders = true) { - const mutation = `mutation{ - orderSettingsUpdate(input:{ - automaticallyConfirmAllNewOrders: ${automaticallyConfirmAllNewOrders} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addProductToOrder(orderId, variantId, quantity = 1) { - const mutation = `mutation{ - orderLinesCreate(id:"${orderId}", input:{ - quantity:${quantity} - variantId: "${variantId}" - }){ - order{ - shippingMethods{ - id - name - } - } - errors{ - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.orderLinesCreate"); -} - -export function createDraftOrder({ customerId, channelId, address }) { - const user = getValueWithDefault(customerId, `user:"${customerId}"`); - - const mutation = `mutation{ - draftOrderCreate(input:{ - ${user} - channelId: "${channelId}" - ${getDefaultAddress(address, "shippingAddress")} - ${getDefaultAddress(address, "billingAddress")} - }){ - errors{ - message - } - order{ - id - number - id - shippingMethods{ - id - name - } - paymentStatus - totalBalance{ - amount - } - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.draftOrderCreate.order"); -} - -export function completeOrder(orderId) { - const mutation = `mutation{ - draftOrderComplete(id:"${orderId}"){ - order{ - id - number - lines{ - id - } - total{ - gross{ - amount - currency - } - } - } - errors{ - message - field - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.draftOrderComplete"); -} - -export function getOrder(orderId) { - const query = `query getOrder{ - order(id:"${orderId}"){ - status - token - paymentStatus - isShippingRequired - transactions{ - id - } - shippingMethod{ - id - } - metadata{ - key - value - } - privateMetadata{ - key - value - } - shippingAddress{ - companyName - streetAddress1 - streetAddress2 - city - postalCode - countryArea - phone - } - billingAddress{ - companyName - streetAddress1 - streetAddress2 - city - postalCode - countryArea - phone - } - fulfillments{ - id - metadata{ - key - value - } - privateMetadata{ - key - value - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.order"); -} -export function getDraftOrdersList() { - const query = `query OrderDraftList{ - draftOrders(first:100){ - edges{ - node{ - id - number - errors{ - message - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.draftOrders"); -} -export function getOrdersList() { - const query = `query OrderList{ - orders(first:100){ - edges{ - node{ - id - number - errors{ - message - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.orders"); -} - -export function fulfillOrder({ orderId, warehouse, quantity, linesId }) { - const lines = linesId.reduce((lines, lineId) => { - const line = `{orderLineId:"${lineId.id}" - stocks:{ - quantity:${quantity} - warehouse:"${warehouse}" - } - }`; - return lines + line; - }, ""); - const mutation = `mutation fulfill{ - orderFulfill(order:"${orderId}" input:{ - lines:[${lines}] - }){ - errors{ - field - message - } - order{ - id - number - } - } -}`; - return cy.sendRequestWithQuery(mutation).its("body.data.orderFulfill"); -} - -export function addShippingMethod(orderId, shippingMethodId) { - const mutation = `mutation{ - orderUpdateShipping(order:"${orderId}", input:{ - shippingMethod:"${shippingMethodId}" - }){ - order{ - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.orderUpdateShipping"); -} diff --git a/cypress/support/api/requests/Page.js b/cypress/support/api/requests/Page.js deleted file mode 100644 index e8eab5a5114..00000000000 --- a/cypress/support/api/requests/Page.js +++ /dev/null @@ -1,39 +0,0 @@ -export function getPage(pageId, auth = "auth") { - const query = `query{ - page(id:"${pageId}"){ - title - isPublished - attributes{ - values{ - inputType - name - } - attribute{ - id - inputType - } - } - } - }`; - return cy.sendRequestWithQuery(query, auth).its("body.data.page"); -} - -export function createPage({ title, pageTypeId, isPublished = false }) { - const mutation = `mutation{ - pageCreate(input:{ - isPublished: ${isPublished} - title:"${title}" - pageType:"${pageTypeId}" - }){ - errors{ - field - message - } - page{ - title - id - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.pageCreate"); -} diff --git a/cypress/support/api/requests/PageType.js b/cypress/support/api/requests/PageType.js deleted file mode 100644 index acb40cdadcb..00000000000 --- a/cypress/support/api/requests/PageType.js +++ /dev/null @@ -1,65 +0,0 @@ -import { getValueWithDefault } from "./utils/Utils"; - -export function getPageType(pageTypeId) { - const query = `query{ - pageType(id:"${pageTypeId}"){ - id - name - attributes{ - name - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.pageType"); -} - -export function createPageType({ name, attributeId }) { - const attributeLine = getValueWithDefault( - attributeId, - `addAttributes:["${attributeId}"]` - ); - - const mutation = `mutation{ - pageTypeCreate(input:{ name: "${name}" ${attributeLine}}){ - pageType{ - name - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.pageTypeCreate"); -} - -export function getPageTypes(first, search) { - const query = `query{ - pageTypes(first: ${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.pageTypes.edges); -} - -export function deletePageType(pageTypeId) { - const mutation = `mutation{ - pageTypeDelete(id:"${pageTypeId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/PermissionGroup.js b/cypress/support/api/requests/PermissionGroup.js deleted file mode 100644 index 295461cd975..00000000000 --- a/cypress/support/api/requests/PermissionGroup.js +++ /dev/null @@ -1,71 +0,0 @@ -import { getValueWithDefault } from "./utils/Utils"; - -export function getPermissionGroups(first, startsWith) { - const query = `query{ - permissionGroups(first:${first} filter:{ - search:"${startsWith}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.permissionGroups.edges); -} - -export function deletePermissionGroup(permissionGroupId) { - const mutation = `mutation{ - permissionGroupDelete(id:"${permissionGroupId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function createPermissionGroup({ - name, - userIdsArray, - permissionsArray -}) { - const users = getValueWithDefault(userIdsArray, `addUsers:${userIdsArray}`); - const mutation = `mutation{ - permissionGroupCreate(input:{ - name:"${name}" - addPermissions:${permissionsArray} - ${users} - }){ - errors{ - field - message - } - group{ - id - name - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.permissionGroupCreate"); -} - -export function getPermissionGroup(permissionGroupId) { - const query = `query{ - permissionGroup(id:"${permissionGroupId}"){ - id - name - users{ - email - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.permissionGroup"); -} diff --git a/cypress/support/api/requests/Permissions.js b/cypress/support/api/requests/Permissions.js deleted file mode 100644 index e89dd670f6d..00000000000 --- a/cypress/support/api/requests/Permissions.js +++ /dev/null @@ -1,12 +0,0 @@ -export function getPermissionsArray(first) { - const query = `query{ - permissionGroups(first:${first}){ - edges{ - node{ - id - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.permissionGroups.edges"); -} diff --git a/cypress/support/api/requests/Plugins.js b/cypress/support/api/requests/Plugins.js deleted file mode 100644 index 0821c5f347b..00000000000 --- a/cypress/support/api/requests/Plugins.js +++ /dev/null @@ -1,37 +0,0 @@ -export function updatePlugin(id, name, value, channel) { - const channelLine = channel ? `channelId: "${channel}"` : ""; - - const mutation = `mutation{ - pluginUpdate( - id:"${id}", - ${channelLine}, - input:{ - configuration:[{ - name:"${name}", - value:"${value}" - }] - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function activatePlugin({ id, channel, active = true }) { - const channelLine = channel ? `channelId: "${channel}"` : ""; - - const mutation = `mutation{ - pluginUpdate(id: "${id}" ${channelLine} input:{ - active:${active} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/Product.js b/cypress/support/api/requests/Product.js deleted file mode 100644 index c1a3e87a282..00000000000 --- a/cypress/support/api/requests/Product.js +++ /dev/null @@ -1,390 +0,0 @@ -import { stringify } from "../../formatData/formatJson"; -import { - getDataForDescriptionInVariables, - getValueWithDefault, - getVariantsListIds, -} from "./utils/Utils"; - -export function getFirstProducts(first, search) { - const filter = search - ? `, filter:{ - search:"${search}" - }` - : ""; - const query = `query{ - products(first:${first}${filter}){ - edges{ - node{ - thumbnail{ - url - } - id - name - variants{ - id - } - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.products.edges); -} - -export function updateProduct(productId, input) { - const mutation = `mutation { - productUpdate(id:"${productId}", input:${stringify(input)} ){ - errors{ - field - message - } - product{ - id - } - } - } - `; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.productUpdate.product"); -} - -export function updateChannelInProduct({ - productId, - channelId, - variantsIdsToAdd = "[]", - variantsIdsToRemove = "[]", - isPublished = true, - isAvailableForPurchase = true, - visibleInListings = true, -}) { - const mutation = `mutation{ - productChannelListingUpdate(id:"${productId}", - input:{ - updateChannels:{ - channelId:"${channelId}" - isPublished:${isPublished} - isAvailableForPurchase:${isAvailableForPurchase} - visibleInListings:${visibleInListings} - addVariants:${variantsIdsToAdd} - removeVariants:${variantsIdsToRemove} - } - }){ - product{ - id - name - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function updateChannelPriceInVariant(variantId, channelId) { - const mutation = `mutation{ - productVariantChannelListingUpdate(id: "${variantId}", input: { - channelId: "${channelId}" - price: 10 - costPrice: 10 - }){ - errors{ - message - } - } - } `; - return cy.sendRequestWithQuery(mutation); -} -export function createProduct({ - attributeId, - attributeValue, - name, - productTypeId, - categoryId, - collectionId, - description, - taxClassId, - slug, -}) { - const collection = getValueWithDefault( - collectionId, - `collections:["${collectionId}"]`, - ); - const category = getValueWithDefault(categoryId, `category:"${categoryId}"`); - const descriptionData = getDataForDescriptionInVariables(description); - const attributeValuesLine = getValueWithDefault( - attributeValue, - `values:["${attributeValue}"]`, - ); - const attributes = getValueWithDefault( - attributeId, - `attributes:[{ - id:"${attributeId}" - ${attributeValuesLine} - }]`, - ); - const selectedTaxClass = getValueWithDefault( - taxClassId, - `taxClass: "${taxClassId}"`, - `taxClass: ""`, - ); - const mutation = `mutation createProduct${descriptionData.mutationVariables}{ - productCreate(input:{ - ${attributes} - name:"${name}" - slug:"${slug ?? name}" - seo:{title:"${name}" description:""} - productType:"${productTypeId}" - ${category} - ${collection} - ${descriptionData.descriptionLine} - ${selectedTaxClass} - }){ - product{ - id - name - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation, "auth", descriptionData.variables, true) - .its("body.data.productCreate.product"); -} - -export function createVariant({ - productId, - sku, - warehouseId, - quantityInWarehouse = 1, - channelId, - attributeId, - price = 1, - costPrice = 1, - trackInventory = true, - weight = 1, - attributeName = "value", -}) { - const skuLines = getValueWithDefault(sku, `sku: "${sku}"`); - - const attributeLines = getValueWithDefault( - attributeId, - `attributes: [{ - id:"${attributeId}" - values: ["${attributeName}"] - }]`, - "attributes:[]", - ); - - const channelListings = getValueWithDefault( - channelId, - `channelListings:{ - channelId:"${channelId}" - price:"${price}" - costPrice:"${costPrice}" - }`, - ); - - const stocks = getValueWithDefault( - warehouseId, - `stocks:{ - warehouse:"${warehouseId}" - quantity:${quantityInWarehouse} - }`, - ); - - const mutation = `mutation{ - productVariantBulkCreate(product: "${productId}", variants: { - ${attributeLines} - weight: ${weight} - ${skuLines} - ${channelListings} - trackInventory:${trackInventory} - ${stocks} - }) { - productVariants{ - id - name - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.productVariantBulkCreate.productVariants"); -} - -export function createVariantForSimpleProduct({ - productId, - sku, - warehouseId, - quantityInWarehouse = 1, - trackInventory = true, - weight = 1, - attributeId, - attributeName = "value", -}) { - const skuLines = getValueWithDefault(sku, `sku: "${sku}"`); - - const attributeLines = getValueWithDefault( - attributeId, - `attributes: [{ - id:"${attributeId}" - values: ["${attributeName}"] - }]`, - "attributes:[]", - ); - - const stocks = getValueWithDefault( - warehouseId, - `stocks:{ - warehouse:"${warehouseId}" - quantity:${quantityInWarehouse} - }`, - ); - const mutation = `mutation{ - productVariantCreate(input: { - ${attributeLines} - ${skuLines} - trackInventory:${trackInventory} - weight: ${weight} - product: "${productId}" - ${stocks} - }) { - productVariant{ - id - name - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.productVariantCreate.productVariant"); -} - -export function deleteProduct(productId) { - const mutation = `mutation{ - productDelete(id: "${productId}"){ - errors{ - field - message - } - } - } `; - return cy.sendRequestWithQuery(mutation); -} - -export function getVariants(variantsList) { - const variantsIds = getVariantsListIds(variantsList); - const query = `query{ - productVariants(first:100 ids:[${variantsIds}]){ - edges{ - node{ - stocks{ - warehouse{ - id - } - quantity - quantityAllocated - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.productVariants"); -} - -export function getVariant(id, channelSlug, auth = "auth") { - const query = `query{ - productVariant(id:"${id}" channel:"${channelSlug}"){ - id - name - stocks{ - warehouse{ - id - } - quantityAllocated - } - sku - attributes{ - attribute{ - inputType - } - values{ - name - } - } - pricing{ - onSale - discount{ - gross{ - amount - } - } - price{ - gross{ - amount - } - } - priceUndiscounted{ - gross{ - amount - } - } - } - } - }`; - return cy.sendRequestWithQuery(query, auth).its("body.data.productVariant"); -} - -export function updateVariantPrice({ variantId, channelId, price }) { - const mutation = `mutation { - productVariantChannelListingUpdate(id:"${variantId}", input:{ - channelId:"${channelId}" - price:${price} - costPrice:${price} - }){ - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.productVariantChannelListingUpdate"); -} - -export function updateVariantWarehouse({ variantId, warehouseId, quantity }) { - const quantityInWarehouse = getValueWithDefault( - quantity, - `quantity:${quantity}`, - `quantity: 0`, - ); - - const mutation = `mutation{ - productVariantStocksCreate(variantId: "${variantId}", - stocks: - { - ${quantityInWarehouse} - warehouse: "${warehouseId}" - } - ){ - errors{ - field - message - } - } - } - `; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/ProductType.js b/cypress/support/api/requests/ProductType.js deleted file mode 100644 index 3882d00e842..00000000000 --- a/cypress/support/api/requests/ProductType.js +++ /dev/null @@ -1,168 +0,0 @@ -import { getValueWithDefault } from "./utils/Utils"; - -export function createTypeProduct({ - name, - attributeId, - hasVariants = true, - slug = name, - shippable = true, - kind = "NORMAL", - productAttributes = true, -}) { - const kindLines = `kind: ${kind}`; - const productAttributesLine = getValueWithDefault( - productAttributes && attributeId, - `productAttributes: "${attributeId}"`, - ); - const variantAttributesLine = getValueWithDefault( - hasVariants && attributeId, - `variantAttributes: "${attributeId}"`, - ); - const mutation = `mutation{ - productTypeCreate(input: { - name: "${name}" - slug: "${slug}" - isDigital: ${!shippable} - ${productAttributesLine} - hasVariants: ${hasVariants} - ${variantAttributesLine} - isShippingRequired:${shippable} - ${kindLines} - }){ - errors{ - field - message - } - productType{ - id - name - } - } - } `; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.productTypeCreate.productType"); -} - -export function getProductTypes(first, search) { - const query = `query{ - productTypes(first:${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.productTypes.edges); -} - -export function deleteProductType(productTypeId) { - const mutation = `mutation{ - productTypeDelete(id:"${productTypeId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function productAttributeAssignmentUpdate({ - productTypeId, - attributeId, - variantSelection = false, -}) { - const mutation = `mutation { - productAttributeAssignmentUpdate( - operations: {id: "${attributeId}", variantSelection: ${variantSelection}} productTypeId:"${productTypeId}") { - errors { - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getProductType(productTypeId) { - const query = `query{ - productType(id:"${productTypeId}"){ - id - name - kind - isShippingRequired - weight{ - value - } - productAttributes{ - name - } - assignedVariantAttributes{ - attribute{ - name - } - variantSelection - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.productType"); -} - -export function createDigitalContent(variantId) { - const mutation = `mutation{ - digitalContentCreate(input:{ - useDefaultSettings:true, - automaticFulfillment: true, - contentFile:"" - }, variantId:"${variantId}"){ - content{ - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function setProductTypeAsDigital(productTypeId, isDigital = true) { - const mutation = `mutation updateProductType{ - productTypeUpdate(id:"${productTypeId}", input:{ - isDigital:${isDigital} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function assignAttribute( - productTypeId, - attributeId, - attributeType = "VARIANT", -) { - const mutation = `mutation{ - productAttributeAssign(productTypeId:"${productTypeId}", operations:{ - id:"${attributeId}" - type: ${attributeType} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/ShippingMethod.js b/cypress/support/api/requests/ShippingMethod.js deleted file mode 100644 index bcb733e3b81..00000000000 --- a/cypress/support/api/requests/ShippingMethod.js +++ /dev/null @@ -1,223 +0,0 @@ -import { getValueWithDefault } from "./utils/Utils"; - -export function createShippingRate({ - name, - shippingZone, - type = "PRICE", - maxWeight, - minWeight, - taxClassId, -}) { - const maxOrderWeight = getValueWithDefault( - maxWeight, - `maximumOrderWeight: ${maxWeight}`, - ); - const minOrderWeight = getValueWithDefault( - minWeight, - `minimumOrderWeight: ${minWeight}`, - ); - - const selectedTaxClass = getValueWithDefault( - taxClassId, - `taxClass: "${taxClassId}"`, - `taxClass: ""`, - ); - - const mutation = `mutation{ - shippingPriceCreate(input:{ - name: "${name}" - shippingZone: "${shippingZone}" - type: ${type} - ${minOrderWeight} - ${maxOrderWeight} - ${selectedTaxClass} - }){ - shippingMethod{ - id - name - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.shippingPriceCreate"); -} - -export function createShippingZone(name, country, channelId, warehouseId) { - const channelsLines = getValueWithDefault( - channelId, - `addChannels:["${channelId}"]`, - ); - const mutation = `mutation{ - shippingZoneCreate(input:{ - name: "${name}" - countries: "${country}" - ${channelsLines} - addWarehouses: ["${warehouseId}"] - }){ - shippingZone{ - id - name - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.shippingZoneCreate.shippingZone"); -} - -export function createShippingZoneWithoutWarehouse(name, country, channelId) { - const channelsLines = getValueWithDefault( - channelId, - `addChannels:["${channelId}"]`, - ); - const mutation = `mutation{ - shippingZoneCreate(input:{ - name: "${name}" - countries: "${country}" - ${channelsLines} - }){ - shippingZone{ - id - name - } - errors{ - field - message - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.shippingZoneCreate.shippingZone"); -} - -export function addChannelToShippingZone(shippingZoneId, channelId) { - const mutation = `mutation addCh{ - shippingZoneUpdate(id:"${shippingZoneId}", input:{ - addChannels:["${channelId}"] - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function addChannelToShippingMethod( - shippingRateId, - channelId, - price, - minProductPrice = 0, -) { - const mutation = `mutation{ - shippingMethodChannelListingUpdate(id:"${shippingRateId}", input:{ - addChannels: { - channelId:"${channelId}" - price: ${price} - minimumOrderPrice:${minProductPrice} - } - }){ - shippingMethod{ - id - channelListings{ - price{ - amount - } - channel{ - slug - } - } - } - errors{ - code - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function deleteShippingZone(shippingZoneId) { - const mutation = `mutation{ - shippingZoneDelete(id:"${shippingZoneId}"){ - errors{ - message - } - } - } - `; - return cy.sendRequestWithQuery(mutation); -} - -export function getShippingZones() { - const query = `query{ - shippingZones(first:100){ - edges{ - node{ - name - id - } - } - } - } - `; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.shippingZones.edges); -} - -export function getShippingZone(shippingZoneId) { - const query = `query{ - shippingZone(id:"${shippingZoneId}"){ - id - name - description - warehouses{ - name - id - } - countries{ - code - } - channels{ - name - id - } - shippingMethods{ - id - name - minimumDeliveryDays - maximumDeliveryDays - minimumOrderWeight{ - value - } - maximumOrderWeight{ - value - } - channelListings{ - price{ - amount - } - minimumOrderPrice{ - amount - } - maximumOrderPrice{ - amount - } - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.shippingZone); -} diff --git a/cypress/support/api/requests/ShopSettings.js b/cypress/support/api/requests/ShopSettings.js deleted file mode 100644 index 4e87895d619..00000000000 --- a/cypress/support/api/requests/ShopSettings.js +++ /dev/null @@ -1,56 +0,0 @@ -import { getDefaultAddress } from "./utils/Utils"; - -export function updateShopWeightUnit(weightUnit) { - const mutation = `mutation{ - shopSettingsUpdate(input:{ - defaultWeightUnit: ${weightUnit} - }){ - errors{ - field - message - } - shop{ - defaultWeightUnit - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .wait(5000) - .its("body.data.shopSettingsUpdate"); -} - -export function updateStockReservation({ - authenticatedUserStock = 0, - anonymousUserStock = 0, -}) { - const mutation = `mutation{ - shopSettingsUpdate(input:{ - reserveStockDurationAnonymousUser: ${anonymousUserStock}, - reserveStockDurationAuthenticatedUser: ${authenticatedUserStock} - }){ - errors{ - field - message - } - shop{ - reserveStockDurationAnonymousUser, - reserveStockDurationAuthenticatedUser - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.shopSettingsUpdate"); -} - -export function updateShopAddress(address) { - const input = getDefaultAddress(address, "input"); - const mutation = `mutation{ - shopAddressUpdate(${input}){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} diff --git a/cypress/support/api/requests/StaffMembers.js b/cypress/support/api/requests/StaffMembers.js deleted file mode 100644 index c77c63c817d..00000000000 --- a/cypress/support/api/requests/StaffMembers.js +++ /dev/null @@ -1,88 +0,0 @@ -import { urlList } from "../../../fixtures/urlList"; - -export function getStaffMembersStartsWith(startsWith) { - const query = `query{ - staffUsers(first:100 filter:{ - search:"${startsWith}" - }){ - edges{ - node{ - id - email - } - } - } - }`; - return cy.sendRequestWithQuery(query); -} - -export function inviteStaffMember({ - email, - isActive = true, - firstName = "", - lastName = "", - permissionId -}) { - const mutation = `mutation createStaff{ - staffCreate(input:{ - firstName: "${firstName}" - lastName: "${lastName}" - email: "${email}", - isActive: ${isActive}, - addGroups:"${permissionId}" - redirectUrl: "${Cypress.config().baseUrl}${urlList.newPassword}" - }){ - user{ - id - } - errors{ - field - message - } - } - } - `; - return cy.sendRequestWithQuery(mutation).its("body.data.staffCreate"); -} - -export function updateStaffMember({ userId, isActive }) { - const mutation = `mutation{ - staffUpdate(id:"${userId}", input:{ - isActive:${isActive} - }){ - user{ - id - } - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.staffUpdate"); -} - -export function deleteStaffMember(staffId) { - const mutation = `mutation{ - staffDelete(id:"${staffId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data.staffDelete"); -} - -export function deleteStaffMembersStartsWith(startsWith) { - getStaffMembersStartsWith(startsWith).then(resp => { - if (resp.body.data.staffUsers) { - const staffMembers = resp.body.data.staffUsers.edges; - staffMembers.forEach(element => { - if (element.node.email.includes(startsWith)) { - deleteStaffMember(element.node.id); - } - }); - } - }); -} diff --git a/cypress/support/api/requests/Taxes.js b/cypress/support/api/requests/Taxes.js deleted file mode 100644 index d2ebb0ec794..00000000000 --- a/cypress/support/api/requests/Taxes.js +++ /dev/null @@ -1,60 +0,0 @@ -export function getTaxConfigurationList() { - const query = `query{ - taxConfigurations(first:100){ - edges{ - node{ - id - channel{ - id - slug - } - } - } - } - } - `; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.taxConfigurations.edges); -} - -export function updateTaxes({ - id, - chargeTaxes = true, - taxCalculationStrategy = "FLAT_RATES", - pricesEnteredWithTax = "false", -}) { - const mutation = `mutation{ - taxConfigurationUpdate(id:"${id}", input:{ - chargeTaxes:${chargeTaxes} - displayGrossPrices:true - pricesEnteredWithTax:${pricesEnteredWithTax} - removeCountriesConfiguration: [] - taxCalculationStrategy:${taxCalculationStrategy} - updateCountriesConfiguration: [] - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getTaxClassList() { - const query = `query{ - taxClasses(first:100){ - edges{ - node{ - id - name - } - } - } - } - `; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.taxClasses.edges); -} diff --git a/cypress/support/api/requests/Warehouse.js b/cypress/support/api/requests/Warehouse.js deleted file mode 100644 index dabc0c8f114..00000000000 --- a/cypress/support/api/requests/Warehouse.js +++ /dev/null @@ -1,103 +0,0 @@ -import { getDefaultAddress, getValueWithDefault } from "./utils/Utils"; - -export function createWarehouse({ name, shippingZone, address, slug = name }) { - const shippingZoneLine = getValueWithDefault( - shippingZone, - `shippingZones:"${shippingZone}"` - ); - const mutation = `mutation{ - createWarehouse(input:{ - name:"${name}" - slug:"${slug}" - ${shippingZoneLine} - ${getDefaultAddress(address, "address", false)} - }){ - errors{ - field - message - } - warehouse{ - id - name - } - } - }`; - return cy - .sendRequestWithQuery(mutation) - .its("body.data.createWarehouse.warehouse"); -} - -export function getWarehouses(first, search) { - const query = `query{ - warehouses(first:${first}, filter:{ - search:"${search}" - }){ - edges{ - node{ - id - name - } - } - } - }`; - return cy - .sendRequestWithQuery(query) - .then(resp => resp.body.data.warehouses.edges); -} - -export function deleteWarehouse(warehouseId) { - const mutation = `mutation{ - deleteWarehouse(id:"${warehouseId}"){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation); -} - -export function getWarehouse(warehouseId) { - const query = `query{ - warehouse(id:"${warehouseId}"){ - id - name - clickAndCollectOption - address{ - companyName - streetAddress1 - streetAddress2 - city - postalCode - countryArea - phone - } - shippingZones(first:100){ - edges{ - node{ - id - } - } - } - } - }`; - return cy.sendRequestWithQuery(query).its("body.data.warehouse"); -} -export function updateWarehouse({ - id, - isPrivate, - clickAndCollectOption = "ALL" -}) { - const mutation = `mutation{ - updateWarehouse(id:"${id}" input:{ - isPrivate:${isPrivate} - clickAndCollectOption:${clickAndCollectOption} - }){ - errors{ - field - message - } - } - }`; - return cy.sendRequestWithQuery(mutation).its("body.data"); -} diff --git a/cypress/support/api/requests/index.js b/cypress/support/api/requests/index.js deleted file mode 100644 index 7c17f008a4b..00000000000 --- a/cypress/support/api/requests/index.js +++ /dev/null @@ -1,21 +0,0 @@ -export { createChannel, updateChannelOrderSettings } from "./Channels"; -export { createCustomer, deleteCustomersStartsWith } from "./Customer"; -export { - createDraftOrder, - getDraftOrdersList, - getOrder, - getOrdersList, - updateOrdersSettings, -} from "./Order"; -export { updateMetadata, updatePrivateMetadata } from "./Metadata"; -export { getProductMetadata } from "./storeFront/ProductDetails"; -export { activatePlugin, updatePlugin } from "./Plugins"; -export { - deleteStaffMembersStartsWith, - updateStaffMember, -} from "./StaffMembers"; -export * as productsRequests from "./Product"; -export * as productsTypeRequests from "./ProductType"; -export * as attributeRequests from "./Attribute"; -export * as pageRequests from "./Page"; -export * as pageTypeRequests from "./PageType"; diff --git a/cypress/support/api/requests/storeFront/Collections.js b/cypress/support/api/requests/storeFront/Collections.js deleted file mode 100644 index 7fd4245c43d..00000000000 --- a/cypress/support/api/requests/storeFront/Collections.js +++ /dev/null @@ -1,23 +0,0 @@ -export function getCollection({ collectionId, channelSlug, auth }) { - const query = `query Collection{ - collection(id: "${collectionId}" channel: "${channelSlug}") { - id - slug - name - description - channelListings{ - isPublished - } - products(first:100){ - totalCount - edges{ - node{ - id - name - } - } - } - } - }`; - return cy.sendRequestWithQuery(query, auth).its("body.data"); -} diff --git a/cypress/support/api/requests/storeFront/ProductDetails.js b/cypress/support/api/requests/storeFront/ProductDetails.js deleted file mode 100644 index f5b125191a6..00000000000 --- a/cypress/support/api/requests/storeFront/ProductDetails.js +++ /dev/null @@ -1,103 +0,0 @@ -import { getValueWithDefault } from "../utils/Utils"; - -export function getProductDetails(productId, channelSlug, auth = "token") { - const privateMetadataLine = getValueWithDefault( - auth === "auth", - `privateMetadata{key value}`, - ); - - const query = `fragment BasicProductFields on Product { - id - name - attributes{ - attribute{ - id - name - } - } - category{ - id - name - } - collections{ - id - name - } - description - seoTitle - slug - seoDescription - rating - metadata{ - key - value - } - ${privateMetadataLine} - productType{ - id - name - isDigital - } - } - - fragment Price on TaxedMoney { - gross { - amount - currency - } - } - - fragment ProductVariantFields on ProductVariant { - id - sku - name - weight{ - unit - value - } - pricing { - price { - ...Price - } - } - } - - query ProductDetails{ - product(id: "${productId}", channel: "${channelSlug}") { - ...BasicProductFields - variants { - ...ProductVariantFields - } - isAvailable - isAvailableForPurchase - availableForPurchase - } - }`; - return cy.sendRequestWithQuery(query, auth); -} - -export function getProductMetadata({ - productId, - channelSlug, - auth, - withPrivateMetadata, -}) { - const privateMetadata = getValueWithDefault( - withPrivateMetadata, - `privateMetadata{ - key - value - }`, - ); - - const query = `query{ - product(id:"${productId}" channel:"${channelSlug}"){ - metadata{ - key - value - } - ${privateMetadata} - } - }`; - return cy.sendRequestWithQuery(query, auth).its("body"); -} diff --git a/cypress/support/api/requests/storeFront/Search.js b/cypress/support/api/requests/storeFront/Search.js deleted file mode 100644 index b323aab205d..00000000000 --- a/cypress/support/api/requests/storeFront/Search.js +++ /dev/null @@ -1,36 +0,0 @@ -export function searchInShop(searchQuery) { - const query = `query SearchProducts { - products(channel: "default-channel", filter:{ - search: "${searchQuery}" - }, - first:10){ - totalCount - edges{ - node{ - id - name - } - } - } - }`; - return cy.sendRequestWithQuery(query, "token"); -} -export function expectProductVisibleInShop(productName, retries = 0) { - return searchInShop(productName).then(searchInShopResponse => { - const productsList = searchInShopResponse.body.data.products; - if ( - productsList.totalCount !== 0 && - productsList.edges[0].node.name === productName - ) { - cy.log(`Found product name: ${productName}`); - return; - } else if (retries > 4) { - throw new Error( - `Product with name ${productName} is not visible in search results. Retried for ${retries} times`, - ); - } else { - cy.wait(5000); - expectProductVisibleInShop(productName, retries + 1); - } - }); -} diff --git a/cypress/support/api/requests/stripe.js b/cypress/support/api/requests/stripe.js deleted file mode 100644 index eabd6ad0fee..00000000000 --- a/cypress/support/api/requests/stripe.js +++ /dev/null @@ -1,106 +0,0 @@ -import { stripeConfirmationUrl, urlList } from "../../../fixtures/urlList"; -import { getValueWithDefault } from "./utils/Utils"; - -const stripeAuthBearer = `Bearer ${Cypress.env("STRIPE_SECRET_KEY")}`; -const stripePublicKey = Cypress.env("STRIPE_PUBLIC_KEY"); - -export function getPaymentMethodStripeId({ - cardNumber, - cvc, - expMonth, - expYear, -}) { - return cy.request({ - url: urlList.stripeApiPaymentMethods, - method: "POST", - form: true, - body: { - type: "card", - "card[number]": cardNumber, - "card[cvc]": cvc, - "card[exp_month]": expMonth, - "card[exp_year]": expYear, - pasted_fields: "number", - key: stripePublicKey, - }, - headers: { - Authorization: stripeAuthBearer, - }, - }); -} - -export function sendConfirmationToStripe(paymentMethodId, confirmationId) { - return cy.request({ - method: "POST", - url: stripeConfirmationUrl(confirmationId), - form: true, - failOnStatusCode: false, - headers: { - Authorization: stripeAuthBearer, - }, - body: { - payment_method: paymentMethodId, - return_url: Cypress.config().baseUrl, - webauthn_uvpa_available: "true", - spc_eligible: "false", - key: stripePublicKey, - }, - }); -} - -export function confirmThreeDSecure(nextActionUrl, withSuccess = true) { - let returnUrl; - const paRes = getValueWithDefault(withSuccess, "success", "failure"); - - return cy - .request(nextActionUrl) - .then(resp => { - const { body } = new DOMParser().parseFromString(resp.body, "text/html"); - const formUrl = body.querySelector('[id="form"]').getAttribute("action"); - const source = body - .querySelector('[name="source_slug"]') - .getAttribute("value"); - returnUrl = body - .querySelector('[name="return_url"]') - .getAttribute("value"); - const amount = body - .querySelector('[name="amount"]') - .getAttribute("value"); - const currency = body - .querySelector('[name="currency"]') - .getAttribute("value"); - const usage = body.querySelector('[name="usage"]').getAttribute("value"); - - const url = `${formUrl}?source_slug=${source}&livemode=false&type=three_d_secure&pass_through=&return_url=${returnUrl}&amount=${amount}¤cy= - ${currency}&usage=${usage}`; - cy.request(url); - }) - .then(() => { - cy.request({ - url: returnUrl, - method: "POST", - form: true, - body: { - PaRes: "success", - MD: "", - }, - }); - }) - .then(resp => { - const { body } = new DOMParser().parseFromString(resp.body, "text/html"); - const formUrl = body.querySelector('[id="form"]').getAttribute("action"); - const merchant = body - .querySelector('[name="merchant"]') - .getAttribute("value"); - cy.request({ - url: formUrl, - method: "POST", - form: true, - body: { - PaRes: paRes, - MD: "", - Merchant: merchant, - }, - }); - }); -} diff --git a/cypress/support/api/requests/utils/Utils.js b/cypress/support/api/requests/utils/Utils.js deleted file mode 100644 index 60539290aca..00000000000 --- a/cypress/support/api/requests/utils/Utils.js +++ /dev/null @@ -1,76 +0,0 @@ -export const getValueWithDefault = (condition, value, defaultValue = "") => - condition ? value : defaultValue; - -export function getDefaultAddress(address, addressType, withName = true) { - if (!address) { - return ""; - } - const defaultAddress = `city: "${address.city}" - country: ${address.country} - countryArea: "${address.countryArea}" - phone: "${address.phone}" - postalCode: "${address.postalCode}" - streetAddress1: "${address.streetAddress1}" - streetAddress2: "${address.streetAddress2}"`; - if (withName) { - defaultAddress.concat(`firstName: "Test" - lastName: "Test" - companyName: "${address.companyName}"`); - } - return `${addressType}:{${defaultAddress}}`; -} - -export function getVariantsLines(variantsList, quantity) { - return variantsList.map( - variant => `{quantity:${quantity} - variantId:"${variant.id}"}` - ); -} - -export function getDefaultAddressWithoutType(address, withName = true) { - const defaultAddress = `city: "${address.city}" - country: ${address.country} - countryArea: "${address.countryArea}" - phone: "${address.phone}" - postalCode: "${address.postalCode}" - streetAddress1: "${address.streetAddress1}" - streetAddress2: "${address.streetAddress2}"`; - if (withName) { - defaultAddress.concat(`firstName: "Test" - lastName: "Test" - companyName: "${address.companyName}"`); - } - return defaultAddress; -} - -export function getVariantsIdsLines(variantsList) { - return variantsList.map(variant => `${variant.id}`); -} - -export function getVariantsListIds(variantsList) { - return variantsList.map(variant => `"${variant.id}"`).join(); -} - -export const getPaymentDataLine = paymentData => - paymentData - ? `, paymentData:"{\\"riskData\\":{\\"clientData\\":\\"${paymentData.clientData}\\"}, \\"paymentMethod\\":{\\"type\\":\\"scheme\\", \\"encryptedCardNumber\\":\\"${paymentData.encryptedCardNumber}\\", \\"encryptedExpiryMonth\\":\\"${paymentData.encryptedExpiryMonth}\\", \\"encryptedExpiryYear\\":\\"${paymentData.encryptedExpiryYear}\\", \\"encryptedSecurityCode\\":\\"${paymentData.encryptedSecurityCode}\\", \\"brand\\":\\"${paymentData.brand}\\"}}"` - : ""; - -export const getValuesInArray = array => - getValueWithDefault(array.length === 1, `["${array}"]`, `${array}`); - -export function getDataForDescriptionInVariables(descriptionJson) { - return { - variables: getValueWithDefault(descriptionJson, { - description: `{\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"${descriptionJson}\"}}]}` - }), - mutationVariables: getValueWithDefault( - descriptionJson, - `($description: JSONString!)` - ), - descriptionLine: getValueWithDefault( - descriptionJson, - `description: $description` - ) - }; -} diff --git a/cypress/support/api/requests/utils/index.js b/cypress/support/api/requests/utils/index.js deleted file mode 100644 index be8669b8736..00000000000 --- a/cypress/support/api/requests/utils/index.js +++ /dev/null @@ -1,37 +0,0 @@ -// / - -import { urlList } from "../../../../fixtures/urlList"; - -Cypress.Commands.add( - "sendRequestWithQuery", - (query, authorization = "auth", variables = "") => { - let headers; - - if (authorization && authorization.length !== 30) { - headers = { - Authorization: `JWT ${window.sessionStorage.getItem(authorization)}`, - }; - } else if (authorization) { - headers = { Authorization: `Bearer ${authorization}` }; - } else { - headers = {}; - } - - cy.request({ - body: { - variables, - query, - }, - headers, - method: "POST", - url: urlList.apiUri, - log: true, - }).then(response => { - const respInSting = JSON.stringify(response.body); - if (respInSting.includes(`"errors":[{`)) { - cy.log(query).log(JSON.stringify(response.body)); - cy.wrap(response); - } - }); - }, -); diff --git a/cypress/support/api/utils/appUtils.js b/cypress/support/api/utils/appUtils.js deleted file mode 100644 index cbb49a207b6..00000000000 --- a/cypress/support/api/utils/appUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteApp, getApps } from "../requests/Apps"; - -export function deleteAppsStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteApp, getApps, startsWith); -} diff --git a/cypress/support/api/utils/attributes/attributeUtils.js b/cypress/support/api/utils/attributes/attributeUtils.js deleted file mode 100644 index 59ac0091b44..00000000000 --- a/cypress/support/api/utils/attributes/attributeUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteAttribute, getAttributes } from "../../requests/Attribute"; - -export function deleteAttributesStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteAttribute, getAttributes, startsWith); -} diff --git a/cypress/support/api/utils/attributes/checkAttributeData.js b/cypress/support/api/utils/attributes/checkAttributeData.js deleted file mode 100644 index b20709e92a2..00000000000 --- a/cypress/support/api/utils/attributes/checkAttributeData.js +++ /dev/null @@ -1,17 +0,0 @@ -export function expectCorrectDataInAttribute( - attribute, - { - attributeName, - attributeType, - entityType = null, - unit = null, - valueRequired = true, - }, -) { - expect(attribute.name).to.eq(attributeName); - expect(attribute.slug).to.eq(attributeName); - expect(attribute.inputType).to.eq(attributeType); - expect(attribute.entityType).to.eq(entityType); - expect(attribute.unit).to.eq(unit); - expect(attribute.valueRequired).to.eq(valueRequired); -} diff --git a/cypress/support/api/utils/catalog/categoryUtils.js b/cypress/support/api/utils/catalog/categoryUtils.js deleted file mode 100644 index 4f9cbba5959..00000000000 --- a/cypress/support/api/utils/catalog/categoryUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteCategory, getCategories } from "../../requests/Category"; - -export function deleteCategoriesStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteCategory, getCategories, startsWith); -} diff --git a/cypress/support/api/utils/catalog/collectionsUtils.js b/cypress/support/api/utils/catalog/collectionsUtils.js deleted file mode 100644 index 84070ec9a65..00000000000 --- a/cypress/support/api/utils/catalog/collectionsUtils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { deleteCollection, getCollections } from "../../requests/Collections"; - -export function deleteCollectionsStartsWith(startsWith) { - cy.deleteElementsStartsWith( - deleteCollection, - getCollections, - startsWith, - "slug" - ); -} diff --git a/cypress/support/api/utils/catalog/giftCardUtils.js b/cypress/support/api/utils/catalog/giftCardUtils.js deleted file mode 100644 index 1039aea8c36..00000000000 --- a/cypress/support/api/utils/catalog/giftCardUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -import { - deleteGiftCard, - getGiftCards, - getGiftCardWithId -} from "../../requests/GiftCard"; -import { - createCheckoutWithVoucher, - purchaseProductWithPromoCode -} from "../ordersUtils"; - -export function deleteGiftCardsWithTagStartsWith(tag) { - getGiftCards(100).then(resp => { - const giftCardArray = resp.body.data.giftCards; - if (giftCardArray) { - giftCardArray.edges.forEach(element => { - const includes = element.node.tags.find(element => - element.name.toLowerCase().includes(tag.toLowerCase()) - ); - if (includes) { - deleteGiftCard(element.node.id); - } - }); - } - }); -} - -export function isGiftCardDataAsExpected({ - giftCardId, - expectedAmount, - userEmail, - initialBalance -}) { - let dataAsExpected = true; - return getGiftCardWithId(giftCardId).then(giftCard => { - if (expectedAmount) { - dataAsExpected = expectedAmount === giftCard.currentBalance.amount; - } - if (userEmail) { - dataAsExpected = userEmail === giftCard.usedByEmail; - } - if (initialBalance) { - dataAsExpected = initialBalance === giftCard.initialBalance.amount; - } - return dataAsExpected; - }); -} - -export function createCheckoutWithDisabledGiftCard({ - channelSlug, - email = "email@example.com", - variantsList, - address, - shippingMethodName, - voucherCode, - auth -}) { - return createCheckoutWithVoucher({ - channelSlug, - email, - variantsList, - address, - shippingMethodName, - voucherCode, - auth - }).then(({ addPromoCodeResp, checkout }) => { - expect(addPromoCodeResp.errors[0].field).to.eq("promoCode"); - return checkout; - }); -} - -export function purchaseProductWithActiveGiftCard({ - giftCard, - expectedAmount, - initialAmount, - dataForCheckout, - expectedOrderPrice -}) { - return purchaseProductWithPromoCode(dataForCheckout).then(({ order }) => { - expect(order.total.gross.amount).to.eq(expectedOrderPrice); - expect(order.userEmail).to.eq(dataForCheckout.email); - return isGiftCardDataAsExpected({ - giftCardId: giftCard.id, - expectedAmount, - userEmail: dataForCheckout.email, - initialBalance: initialAmount - }); - }); -} diff --git a/cypress/support/api/utils/channelsUtils.js b/cypress/support/api/utils/channelsUtils.js deleted file mode 100644 index 0fdb147ec46..00000000000 --- a/cypress/support/api/utils/channelsUtils.js +++ /dev/null @@ -1,34 +0,0 @@ -import * as channels from "../requests/Channels"; - -export function deleteChannelsStartsWith(nameStartsWith) { - channels.getChannels().then(resp => { - const channelsArray = new Set(resp.body.data.channels); - if (!channelsArray) { - return; - } - channelsArray.forEach(element => { - if (element.name.startsWith(nameStartsWith)) { - const targetChannels = Array.from(channelsArray).filter(function( - channelElement - ) { - return ( - element.currencyCode === channelElement.currencyCode && - element.id !== channelElement.id - ); - }); - if (targetChannels[0]) { - channels.deleteChannel(element.id, targetChannels[0].id); - channelsArray.delete(element); - } - } - }); - }); -} -export function getDefaultChannel() { - return channels.getChannels().then(resp => { - const channelsArray = resp.body.data.channels; - return channelsArray.find(function(channelElement) { - return channelElement.slug === "default-channel"; - }); - }); -} diff --git a/cypress/support/api/utils/discounts/salesUtils.js b/cypress/support/api/utils/discounts/salesUtils.js deleted file mode 100644 index 7adb7b97223..00000000000 --- a/cypress/support/api/utils/discounts/salesUtils.js +++ /dev/null @@ -1,78 +0,0 @@ -import { getVariant } from "../../../../support/api/requests/Product"; -import { - addChannelToSale, - createSale, - deleteSale, - getSales, - updateSale, -} from "../../requests/Discounts/Sales"; - -export function deleteSalesStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteSale, getSales, startsWith); -} - -export function createSaleInChannel({ - name, - type, - value, - channelId, - discountValue = value, -}) { - let sale; - return createSale({ - name, - type, - value, - }) - .then(saleResp => { - sale = saleResp; - addChannelToSale(sale.id, channelId, discountValue); - }) - .then(() => sale); -} -export function getVariantWithSaleStatus( - { variantId, channelSlug, onSaleStatus }, - retries = 0, -) { - return getVariant(variantId, channelSlug).then(salesResponse => { - if (salesResponse.pricing.onSale === onSaleStatus) { - return; - } else if (retries > 4) { - throw new Error( - `Variant field onSale should have value: ${onSaleStatus} but has opposite. Retried for ${retries} times`, - ); - } else { - cy.wait(5000); - getVariantWithSaleStatus( - { variantId, channelSlug, onSaleStatus }, - retries + 1, - ); - } - }); -} - -export function createSaleInChannelWithProduct({ - name, - type, - value, - channelId, - variants, - productId, -}) { - let sale; - return createSaleInChannel({ - name, - type, - value, - channelId, - }) - .then(saleResp => { - sale = saleResp; - updateSale({ - saleId: sale.id, - variants, - productId, - }); - }) - .then(() => sale); -} diff --git a/cypress/support/api/utils/discounts/vouchersUtils.js b/cypress/support/api/utils/discounts/vouchersUtils.js deleted file mode 100644 index 76d28c31ab7..00000000000 --- a/cypress/support/api/utils/discounts/vouchersUtils.js +++ /dev/null @@ -1,29 +0,0 @@ -import { - addChannelToVoucher, - createVoucher, - deleteVouchers, - getVouchers, -} from "../../requests/Discounts/Vouchers"; - -export function deleteVouchersStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteVouchers, getVouchers, startsWith, "code"); -} - -export function createVoucherInChannel({ - name, - productId, - channelId, - value, - code = name, - type, - country, -}) { - let voucherCreate; - - return createVoucher({ name, productId, code, type, country }) - .then(({ voucherCreate: voucherResp }) => { - voucherCreate = voucherResp; - addChannelToVoucher(voucherCreate.voucher.id, channelId, value); - }) - .then(() => voucherCreate); -} diff --git a/cypress/support/api/utils/homePageUtils.js b/cypress/support/api/utils/homePageUtils.js deleted file mode 100644 index 178ccb8ee07..00000000000 --- a/cypress/support/api/utils/homePageUtils.js +++ /dev/null @@ -1,30 +0,0 @@ -import * as homePage from "../requests/HomePage"; -import { getDatePeriod } from "./misc"; - -export function getOrdersReadyToFulfill(channelSlug) { - return homePage - .getOrdersWithStatus("READY_TO_FULFILL", channelSlug) - .its("body.data.orders.totalCount"); -} -export function getOrdersReadyForCapture(channelSlug) { - return homePage - .getOrdersWithStatus("READY_TO_CAPTURE", channelSlug) - .its("body.data.orders.totalCount"); -} -export function getProductsOutOfStock(channelSlug) { - return homePage - .getProductsOutOfStock(channelSlug) - .its("body.data.products.totalCount"); -} -export function getSalesAmount(channelSlug) { - return homePage - .getSalesForChannel(channelSlug, "TODAY") - .its("body.data.ordersTotal.gross.amount"); -} -export function getTodaysOrders(channelSlug) { - const today = getDatePeriod(1); - - return homePage - .getOrdersForChannel(channelSlug, today) - .its("body.data.orders.totalCount"); -} diff --git a/cypress/support/api/utils/index.js b/cypress/support/api/utils/index.js deleted file mode 100644 index 4c6e06dc244..00000000000 --- a/cypress/support/api/utils/index.js +++ /dev/null @@ -1,22 +0,0 @@ -export { deleteChannelsStartsWith, getDefaultChannel } from "./channelsUtils"; -export { createShipping, deleteShippingStartsWith } from "./shippingUtils"; -export { - getDefaultTaxClass, - updateTaxConfigurationForChannel, -} from "./taxesUtils"; -export * as productsUtils from "./products/productsUtils"; -export * as ordersUtils from "./ordersUtils"; -export * as shippingUtils from "./shippingUtils"; -export * as storeFrontProductsUtils from "./storeFront/storeFrontProductUtils"; - -export { - createFulfilledOrder, - createOrder, - createReadyToFulfillOrder, - createUnconfirmedOrder, -} from "./ordersUtils"; -export { - getMailActivationLinkForUser, - getMailActivationLinkForUserAndSubject, - inviteStaffMemberWithFirstPermission, -} from "./users"; diff --git a/cypress/support/api/utils/misc.js b/cypress/support/api/utils/misc.js deleted file mode 100644 index 76122ad8b69..00000000000 --- a/cypress/support/api/utils/misc.js +++ /dev/null @@ -1,23 +0,0 @@ -import moment from "moment-timezone"; - -const format = "YYYY-MM-DD"; - -export function getDatePeriod(days) { - if (days < 1) { - return {}; - } - - const end = moment().startOf("day"); - const start = end.subtract(days - 1); - - return { - gte: start.format(format), - lte: end.format(format) - }; -} - -export function addToDate(date, amount, periodType) { - const currentDate = moment(date); - const futureDate = moment(currentDate).add(amount, periodType); - return futureDate.format(format); -} diff --git a/cypress/support/api/utils/navigationUtils.js b/cypress/support/api/utils/navigationUtils.js deleted file mode 100644 index 27a6b8bd752..00000000000 --- a/cypress/support/api/utils/navigationUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteMenu, getMenus } from "../requests/Menu"; - -export function deleteMenusStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteMenu, getMenus, startsWith); -} diff --git a/cypress/support/api/utils/ordersUtils.js b/cypress/support/api/utils/ordersUtils.js deleted file mode 100644 index fd978688505..00000000000 --- a/cypress/support/api/utils/ordersUtils.js +++ /dev/null @@ -1,332 +0,0 @@ -import * as checkoutRequest from "../requests/Checkout"; -import * as orderRequest from "../requests/Order"; -import { - getPaymentMethodStripeId, - sendConfirmationToStripe, -} from "../requests/stripe"; -import { createProductInChannel } from "./products/productsUtils"; - -export function createWaitingForCaptureOrder({ - channelSlug, - email, - variantsList, - shippingMethodName, - address, -}) { - let checkout; - const auth = "token"; - cy.loginInShop(); - return checkoutRequest - .createCheckout({ - channelSlug, - email, - variantsList, - address, - billingAddress: address, - auth, - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - const shippingMethodId = getShippingMethodIdFromCheckout( - checkout, - shippingMethodName, - ); - checkoutRequest.addShippingMethod(checkout.id, shippingMethodId); - }) - .then(() => addPayment(checkout.id)) - .then(() => checkoutRequest.completeCheckout(checkout.id)) - .then(({ order }) => ({ checkout, order })); -} - -export function getShippingMethodIdFromCheckout(checkout, shippingMethodName) { - const availableShippingMethodsLength = checkout.shippingMethods.length; - if (availableShippingMethodsLength === 0) { - return null; - } else { - return checkout.shippingMethods.find( - element => element.name === shippingMethodName, - ).id; - } -} - -export function updateShippingInCheckout(checkoutToken, shippingMethodName) { - return checkoutRequest.getCheckout(checkoutToken).then(checkout => { - const shippingMethodId = getShippingMethodIdFromCheckout( - checkout, - shippingMethodName, - ); - return checkoutRequest.checkoutShippingMethodUpdate( - checkout.id, - shippingMethodId, - ); - }); -} - -export function createCheckoutWithVoucher({ - channelSlug, - email = "email@example.com", - variantsList, - productQuantity = 1, - address, - shippingMethodName, - voucherCode, - auth, -}) { - let checkout; - return checkoutRequest - .createCheckout({ - channelSlug, - productQuantity, - email, - variantsList, - address, - billingAddress: address, - auth, - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - const shippingMethodId = getShippingMethodIdFromCheckout( - checkout, - shippingMethodName, - ); - checkoutRequest.addShippingMethod(checkout.id, shippingMethodId); - }) - .then(() => { - checkoutRequest.addVoucher(checkout.id, voucherCode); - }) - .then(resp => ({ - addPromoCodeResp: resp.body.data.checkoutAddPromoCode, - checkout, - })); -} - -export function purchaseProductWithPromoCode({ - channelSlug, - email = "email@example.com", - variantsList, - address, - shippingMethodName, - voucherCode, - auth, -}) { - let checkout; - - return createCheckoutWithVoucher({ - channelSlug, - email, - variantsList, - address, - shippingMethodName, - voucherCode, - auth, - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - addPayment(checkout.id); - }) - .then(() => checkoutRequest.completeCheckout(checkout.id)) - .then(({ order }) => ({ checkout, order })); -} - -export function createReadyToFulfillOrder({ - customerId, - shippingMethod, - channelId, - variantsList, - address, -}) { - let order; - return orderRequest - .createDraftOrder({ customerId, channelId, address }) - .then(orderResp => { - order = orderResp; - assignVariantsToOrder(order, variantsList); - }) - .then(orderResp => { - shippingMethod = getShippingMethodIdFromCheckout( - orderResp.order, - shippingMethod.name, - ); - orderRequest.addShippingMethod(order.id, shippingMethod); - }) - .then(() => orderRequest.completeOrder(order.id)) - .then(() => orderRequest.markOrderAsPaid(order.id)); -} - -export function createFulfilledOrder({ - customerId, - shippingMethod, - channelId, - variantsList, - address, - warehouse, - quantity = 1, -}) { - return createReadyToFulfillOrder({ - customerId, - shippingMethod, - channelId, - variantsList, - address, - }).then(({ order }) => { - orderRequest.fulfillOrder({ - orderId: order.id, - warehouse, - quantity, - linesId: order.lines, - }); - }); -} - -export function createOrder({ - customerId, - shippingMethod, - channelId, - variantsList, - address, -}) { - let order; - return orderRequest - .createDraftOrder({ customerId, channelId, address }) - .then(orderResp => { - order = orderResp; - assignVariantsToOrder(order, variantsList); - }) - .then(orderResp => { - shippingMethod = getShippingMethodIdFromCheckout( - orderResp.order, - shippingMethod.name, - ); - orderRequest.addShippingMethod(order.id, shippingMethod); - }) - .then(() => orderRequest.completeOrder(order.id)) - .then(resp => (order = resp.order)); -} - -function assignVariantsToOrder(order, variantsList) { - variantsList.forEach(variantElement => { - orderRequest.addProductToOrder(order.id, variantElement.id); - }); -} -export function createUnconfirmedOrder({ - customerId, - shippingMethod, - channelId, - variantsList, - address, -}) { - let order; - return orderRequest - .createDraftOrder({ customerId, channelId, address }) - .then(orderResp => { - order = orderResp; - assignVariantsToOrder(order, variantsList); - }) - .then(orderResp => { - shippingMethod = getShippingMethodIdFromCheckout( - orderResp.order, - shippingMethod.name, - ); - orderRequest.addShippingMethod(order.id, shippingMethod); - }); -} - -export function addPayment(checkoutId) { - return checkoutRequest.addPayment({ - checkoutId, - gateway: "mirumee.payments.dummy", - token: "not-charged", - }); -} - -export function addAdyenPayment(checkoutId, amount) { - return checkoutRequest.addPayment({ - checkoutId, - gateway: "mirumee.payments.adyen", - amount, - }); -} -export function addStripePayment(checkoutId, amount, token) { - return checkoutRequest.addPayment({ - checkoutId, - gateway: "saleor.payments.stripe", - amount, - token, - }); -} - -export function createAndCompleteCheckoutWithoutShipping({ - channelSlug, - email, - variantsList, - billingAddress, - auth, -}) { - let checkout; - return checkoutRequest - .createCheckout({ channelSlug, email, variantsList, billingAddress, auth }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - addPayment(checkout.id); - }) - .then(() => checkoutRequest.completeCheckout(checkout.id)) - .then(({ order }) => ({ checkout, order })); -} - -export function createOrderWithNewProduct({ - attributeId, - categoryId, - productTypeId, - channel, - name, - warehouseId, - quantityInWarehouse = 1, - trackInventory = true, - shippingMethod, - address, -}) { - let variantsList; - return createProductInChannel({ - attributeId, - categoryId, - productTypeId, - channelId: channel.id, - name, - warehouseId, - quantityInWarehouse, - trackInventory, - }) - .then(({ variantsList: variantsListResp }) => { - variantsList = variantsListResp; - createWaitingForCaptureOrder({ - channelSlug: channel.slug, - email: "email@example.com", - variantsList, - shippingMethodName: shippingMethod.name, - address, - }); - }) - .then(({ order, checkout }) => ({ order, checkout, variantsList })); -} - -export function addStripePaymentAndGetConfirmationData({ - card, - checkoutId, - amount, -}) { - let paymentMethodId; - - return getPaymentMethodStripeId(card) - .then(resp => { - paymentMethodId = resp.body.id; - addStripePayment(checkoutId, amount, resp.body.id); - }) - .then(() => { - checkoutRequest.completeCheckout(checkoutId); - }) - .then(resp => { - const confirmationData = JSON.parse(resp.confirmationData); - sendConfirmationToStripe(paymentMethodId, confirmationData.id, false); - }) - .then(resp => resp); -} diff --git a/cypress/support/api/utils/pageTypeUtils.js b/cypress/support/api/utils/pageTypeUtils.js deleted file mode 100644 index 6e96a59128e..00000000000 --- a/cypress/support/api/utils/pageTypeUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deletePageType, getPageTypes } from "../requests/PageType"; - -export function deletePageTypesStartsWith(startsWith) { - cy.deleteElementsStartsWith(deletePageType, getPageTypes, startsWith); -} diff --git a/cypress/support/api/utils/permissionGroupUtils.js b/cypress/support/api/utils/permissionGroupUtils.js deleted file mode 100644 index abd8f570fb0..00000000000 --- a/cypress/support/api/utils/permissionGroupUtils.js +++ /dev/null @@ -1,12 +0,0 @@ -import { - deletePermissionGroup, - getPermissionGroups -} from "../requests/PermissionGroup"; - -export function deletePermissionGroupsStartsWith(startsWith) { - cy.deleteElementsStartsWith( - deletePermissionGroup, - getPermissionGroups, - startsWith - ); -} diff --git a/cypress/support/api/utils/productTypeUtils.js b/cypress/support/api/utils/productTypeUtils.js deleted file mode 100644 index 58ea48b6eb4..00000000000 --- a/cypress/support/api/utils/productTypeUtils.js +++ /dev/null @@ -1,51 +0,0 @@ -import { createAttribute } from "../requests/Attribute"; -import { updateVariantPrice } from "../requests/Product"; -import { - createDigitalContent, - createTypeProduct, - productAttributeAssignmentUpdate, - setProductTypeAsDigital -} from "../requests/ProductType"; - -export function addDigitalContentAndUpdateProductType( - variantId, - productTypeId, - channelId, - price = 1 -) { - createDigitalContent(variantId); - setProductTypeAsDigital(productTypeId); - updateVariantPrice({ variantId, channelId, price }); -} - -export function createProductTypeWithNewVariantSelectionAttribute({ - name, - inputType, - attributeValues -}) { - let attribute; - let productType; - - return createAttribute({ - name, - inputType, - attributeValues - }) - .then(attributeResp => { - attribute = attributeResp; - createTypeProduct({ - name, - attributeId: attribute.id, - productAttributes: false - }); - }) - .then(productTypeResp => { - productType = productTypeResp; - productAttributeAssignmentUpdate({ - productTypeId: productType.id, - attributeId: attribute.id, - variantSelection: true - }); - }) - .then(() => ({ attribute, productType })); -} diff --git a/cypress/support/api/utils/products/checkProductInfo.js b/cypress/support/api/utils/products/checkProductInfo.js deleted file mode 100644 index 9a98c41ab18..00000000000 --- a/cypress/support/api/utils/products/checkProductInfo.js +++ /dev/null @@ -1,75 +0,0 @@ -export function expectCorrectProductInformation(productResp, productData) { - expectCorrectGeneralInformation(productResp, productData.generalInfo); - expectCorrectSeoInfo(productResp, productData.seo); - expectCorrectMetadataInfo(productResp.metadata, productData.metadata.public); - expectCorrectMetadataInfo( - productResp.privateMetadata, - productData.metadata.private, - ); - expectCorrectProductOrgInfo(productResp, productData.productOrganization); - expectCorrectAttribute(productResp.attributes, productData.attribute); -} - -export function expectCorrectProductVariantInformation( - variantsResp, - variantName, - prices, -) { - expect(variantsResp).to.have.length(1); - expect(variantsResp[0].sku).to.be.eq(variantName); - expect(variantsResp[0].channelListings[0].costPrice.amount).to.be.eq( - prices.costPrice, - ); - expect(variantsResp[0].channelListings[0].price.amount).to.be.eq( - prices.sellingPrice, - ); -} - -function expectCorrectGeneralInformation(productResp, generalInfo) { - expect(productResp.name, "Check product name").to.be.eq(generalInfo.name); - expect(productResp.description, "Check product description").includes( - generalInfo.description, - ); - expect(productResp.rating, "Check product rate").to.be.eq(generalInfo.rating); -} - -function expectCorrectSeoInfo(productResp, seo) { - expect(productResp.slug, "Check product slug").to.be.eq(seo.slug); - expect(productResp.seoTitle, "Check product seo title").to.be.eq(seo.title); - expect(productResp.seoDescription, "Check product seo description").to.be.eq( - seo.description, - ); -} - -function expectCorrectMetadataInfo(metadataResp, expectedMetadata) { - expect(metadataResp, "Check metadata fields length").to.have.length(1); - expect(metadataResp[0].key, "Check product metadata key").to.be.eq( - expectedMetadata.name, - ); - expect(metadataResp[0].value, "Check product metadata value").to.be.eq( - expectedMetadata.value, - ); -} - -function expectCorrectProductOrgInfo(productResp, productOrganization) { - expect(productResp.productType.name, "Check product type name").to.be.eq( - productOrganization.productType, - ); - expect(productResp.category.name, "Check category name").to.be.eq( - productOrganization.category, - ); - expect( - productResp.collections, - "Check length of assigned collections", - ).to.have.length(1); - expect(productResp.collections[0].name, "Check collection name").to.be.eq( - productOrganization.collection, - ); -} - -function expectCorrectAttribute(attributes, attribute) { - expect(attributes).to.have.length(1); - expect(attributes[0].attribute.name, "Check attribute name").to.be.eq( - attribute.name, - ); -} diff --git a/cypress/support/api/utils/products/productsListUtils.js b/cypress/support/api/utils/products/productsListUtils.js deleted file mode 100644 index d12afaacb57..00000000000 --- a/cypress/support/api/utils/products/productsListUtils.js +++ /dev/null @@ -1,62 +0,0 @@ -import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list"; - -export function getDisplayedColumnArray(columnName) { - let productsList = new Array(); - return cy - .get(PRODUCTS_LIST.productsList) - .each($product => { - cy.wrap($product) - .find(PRODUCTS_LIST.productRowElements[columnName]) - .invoke("text") - .then(productName => { - productsList = productsList.concat([productName]); - }); - }) - .then(() => productsList); -} -export function expectProductsSortedBy(columnName, inAscOrder = true) { - let sortedProductsArray; - let productsArray; - - cy.get(PRODUCTS_LIST.emptyProductRow).should("not.exist"); - getDisplayedColumnArray(columnName) - .then(productsArrayResp => { - productsArray = productsArrayResp; - sortedProductsArray = productsArray.slice(); - if (columnName !== "price") { - sortedProductsArray = sortedProductsArray.sort((a, b) => - a.localeCompare(b, undefined, { ignorePunctuation: true }), - ); - if (!inAscOrder) { - sortedProductsArray.reverse(); - } - } else { - sortedProductsArray = getSortedPriceColumn( - sortedProductsArray, - inAscOrder, - ); - if (!inAscOrder) { - sortedProductsArray.reverse(); - } - } - }) - .then(() => { - expect( - JSON.stringify(productsArray) === JSON.stringify(sortedProductsArray), - ).to.be.eq(true); - }); -} -function getSortedPriceColumn(productsArray, inAscOrder) { - return inAscOrder - ? productsArray.sort(sortColumnByPrice) - : productsArray.sort(sortColumnByPrice).reverse(); -} -function sortColumnByPrice(a, b) { - return ( - getMinimalPriceFromPriceRangeCell(a) > getMinimalPriceFromPriceRangeCell(b) - ); -} -function getMinimalPriceFromPriceRangeCell(priceRange) { - const regex = /\d+,\d+/; - return parseFloat(priceRange.match(regex)); -} diff --git a/cypress/support/api/utils/products/productsUtils.js b/cypress/support/api/utils/products/productsUtils.js deleted file mode 100644 index b3c0ff7ae37..00000000000 --- a/cypress/support/api/utils/products/productsUtils.js +++ /dev/null @@ -1,544 +0,0 @@ -import * as attributeRequest from "../../requests/Attribute"; -import * as categoryRequest from "../../requests/Category"; -import { createChannel } from "../../requests/Channels"; -import { createCollection } from "../../requests/Collections"; -import * as productRequest from "../../requests/Product"; -import { - createDigitalContent, - createTypeProduct, - deleteProductType, - getProductTypes, - productAttributeAssignmentUpdate, - setProductTypeAsDigital, -} from "../../requests/ProductType"; -import { deleteAttributesStartsWith } from "../attributes/attributeUtils"; -import { getDefaultChannel } from "../channelsUtils"; -import { - createShipping, - createShippingWithDefaultChannelAndAddress, -} from "../shippingUtils"; - -export function createProductInChannel({ - name, - channelId, - warehouseId = null, - quantityInWarehouse = 10, - productTypeId, - attributeId, - categoryId, - price = 1, - isPublished = true, - isAvailableForPurchase = true, - visibleInListings = true, - collectionId = null, - description = null, - trackInventory = true, - weight = 1, - sku = name, - taxClassId, - slug, -}) { - let product; - let variantsList; - return createProductInChannelWithoutVariants({ - name, - channelId, - productTypeId, - attributeId, - categoryId, - isPublished, - isAvailableForPurchase, - visibleInListings, - collectionId, - description, - taxClassId, - slug, - }) - .then(productResp => { - product = productResp; - productRequest.createVariant({ - productId: product.id, - sku, - attributeId, - warehouseId, - quantityInWarehouse, - channelId, - price, - trackInventory, - weight, - }); - }) - .then(variantsResp => { - variantsList = variantsResp; - return { product, variantsList }; - }); -} - -export function createTypeAttributeAndCategoryForProduct({ - name, - attributeValues, - kind = "NORMAL", - slug, -}) { - let attribute; - let productType; - let category; - return attributeRequest - .createAttribute({ name, attributeValues }) - .then(attributeResp => { - attribute = attributeResp; - createTypeProduct({ name, attributeId: attributeResp.id, kind, slug }); - }) - .then(productTypeResp => { - productType = productTypeResp; - productAttributeAssignmentUpdate({ - productTypeId: productType.id, - attributeId: attribute.id, - variantSelection: true, - }); - categoryRequest.createCategory({ name, slug }); - }) - .then(categoryResp => { - category = categoryResp; - return { attribute, category, productType }; - }); -} - -export function deleteProductsStartsWith(startsWith) { - deleteAttributesStartsWith(startsWith); - cy.deleteElementsStartsWith(deleteProductType, getProductTypes, startsWith); - cy.deleteElementsStartsWith( - categoryRequest.deleteCategory, - categoryRequest.getCategories, - startsWith, - ); - cy.deleteElementsStartsWith( - productRequest.deleteProduct, - productRequest.getFirstProducts, - startsWith, - ); -} - -export function createNewProductWithNewDataAndDefaultChannel({ - name, - description = name, - warehouseId, - attributeValues = ["value"], - sku = name, - productPrice = 10, -}) { - return getDefaultChannel().then(channel => { - createNewProductWithNewDataAndChannel({ - name, - description, - warehouseId, - attributeValues, - sku, - productPrice, - defaultChannel: channel, - }); - }); -} - -export function createNewProductWithNewDataAndChannel({ - name, - description = name, - warehouseId, - attributeValues = ["value"], - sku = name, - productPrice = 10, - defaultChannel, -}) { - let collection; - let attribute; - let category; - let productType; - - return createCollection(name) - .then(collectionResp => { - collection = collectionResp; - createTypeAttributeAndCategoryForProduct({ name, attributeValues }); - }) - .then( - ({ - attribute: attributeResp, - category: categoryResp, - productType: productTypeResp, - }) => { - attribute = attributeResp; - category = categoryResp; - productType = productTypeResp; - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - name, - collectionId: collection.id, - description, - warehouseId, - price: productPrice, - sku, - }); - }, - ) - .then(({ product, variantsList }) => ({ - product, - variantsList, - attribute, - category, - productType, - })); -} - -export function createProductWithShipping({ - name, - attributeValues = ["value"], - sku = name, - productPrice = 10, - shippingPrice = 10, - newChannel = false, -}) { - let address; - let warehouse; - let shippingMethod; - let defaultChannel; - let shippingZone; - - return cy - .fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - if (!newChannel) { - getDefaultChannel(); - } else { - createChannel({ name }); - } - }) - .then(channelResp => { - defaultChannel = channelResp; - createShipping({ - channelId: defaultChannel.id, - name, - address, - price: shippingPrice, - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingZone: shippingZoneResp, - shippingMethod: shippingMethodResp, - }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - shippingZone = shippingZoneResp; - createNewProductWithNewDataAndChannel({ - name, - warehouseId: warehouse.id, - productPrice, - attributeValues, - sku, - defaultChannel, - }); - }, - ) - .then(({ variantsList, product, attribute, category, productType }) => ({ - variantsList, - product, - warehouse, - shippingZone, - defaultChannel, - shippingMethod, - address, - attribute, - category, - productType, - })); -} - -export function createProductInChannelWithoutVariants({ - name, - channelId, - productTypeId, - attributeId, - categoryId, - isPublished = true, - isAvailableForPurchase = true, - visibleInListings = true, - collectionId = null, - description = null, - taxClassId, - slug, -}) { - let product; - return productRequest - .createProduct({ - attributeId, - name, - productTypeId, - categoryId, - collectionId, - description, - taxClassId, - slug, - }) - .then(productResp => { - product = productResp; - productRequest.updateChannelInProduct({ - productId: product.id, - channelId, - isPublished, - isAvailableForPurchase, - visibleInListings, - }); - }) - .then(() => product); -} - -export function addDigitalContentAndUpdateProductType( - variantId, - productTypeId, - channelId, - price = 1, -) { - createDigitalContent(variantId); - setProductTypeAsDigital(productTypeId); - productRequest.updateVariantPrice({ variantId, channelId, price }); -} - -export function createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({ - physicalProductName, - digitalProductName, -}) { - let physicalVariants; - let digitalVariants; - let warehouse; - let attribute; - let shippingMethod; - let defaultChannel; - let address; - let category; - let digitalProductType; - - return createProductWithShipping({ - name: physicalProductName, - attributeValues: ["physical"], - }) - .then(resp => { - physicalVariants = resp.variantsList; - warehouse = resp.warehouse; - shippingMethod = resp.shippingMethod; - attribute = resp.attribute; - defaultChannel = resp.defaultChannel; - address = resp.address; - category = resp.category; - - createTypeProduct({ - name: digitalProductName, - shippable: false, - attributeId: attribute.id, - }); - }) - .then(productType => { - digitalProductType = productType; - createProductInChannel({ - attributeId: attribute.id, - productTypeId: productType.id, - categoryId: category.id, - channelId: defaultChannel.id, - name: digitalProductName, - warehouseId: warehouse.id, - }); - }) - .then(({ variantsList }) => { - digitalVariants = variantsList; - addDigitalContentAndUpdateProductType( - digitalVariants[0].id, - digitalProductType.id, - defaultChannel.id, - ); - }) - .then(() => ({ - digitalVariants, - physicalVariants, - shippingMethod, - defaultChannel, - address, - })); -} - -export function createNewProductWithSeveralVariants(name, variantsData) { - let address; - let defaultChannel; - let warehouse; - let shippingMethod; - const createdVariants = []; - let attribute; - let productType; - let category; - - return cy - .fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - getDefaultChannel(); - }) - .then(channel => { - defaultChannel = channel; - createShipping({ - channelId: defaultChannel.id, - name, - address, - }); - }) - .then( - ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - - const attributeValues = []; - variantsData.forEach(variant => { - attributeValues.push(variant.name); - }); - - createTypeAttributeAndCategoryForProduct({ - name, - attributeValues, - }); - }, - ) - .then( - ({ - attribute: attributeResp, - category: categoryResp, - productType: productTypeResp, - }) => { - attribute = attributeResp; - category = categoryResp; - productType = productTypeResp; - - createProductInChannelWithoutVariants({ - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - name, - }); - }, - ) - .then(product => { - variantsData.forEach(variant => { - productRequest - .createVariant({ - productId: product.id, - attributeId: attribute.id, - channelId: defaultChannel.id, - attributeName: variant.name, - trackInventory: variant.trackInventory, - warehouseId: warehouse.id, - quantityInWarehouse: variant.quantityInWarehouse, - }) - .then(variants => { - createdVariants.push(variants[0]); - }); - }); - }) - .then(() => ({ createdVariants, address, shippingMethod, defaultChannel })); -} - -export function createShippingProductTypeAttributeAndCategory( - name, - attributeValues, -) { - let warehouse; - let defaultChannel; - let shippingMethod; - - return createShippingWithDefaultChannelAndAddress(name) - .then( - ({ - warehouse: warehouseResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - }) => { - warehouse = warehouseResp; - defaultChannel = channel; - shippingMethod = shippingMethodResp; - - createTypeAttributeAndCategoryForProduct({ name, attributeValues }); - }, - ) - .then(({ attribute, productType, category }) => ({ - attribute, - productType, - category, - warehouse, - defaultChannel, - shippingMethod, - })); -} - -export function sendRequestForMediaThumbnails(thumbnailUrl, productId) { - return cy - .request({ - url: thumbnailUrl, - followRedirect: false, - failOnStatusCode: false, - }) - .then(response => { - if (response.status !== 302) { - return `product: ${productId}, expectedStatus: 302, status: ${response.status}`; - } else { - cy.request({ - url: response.redirectedToUrl, - failOnStatusCode: false, - }).then(resp => { - if (resp.status !== 200) { - return `product: ${productId}, expectedStatus: 200, status: ${resp.status}`; - } else { - return null; - } - }); - } - }); -} - -export function sendRequestForThumbnails(thumbnailUrl, productId) { - return cy - .request({ url: thumbnailUrl, failOnStatusCode: false }) - .then(response => { - if (response.status !== 200) { - return `product: ${productId}, expectedStatus: 200, status: ${response.status}`; - } else { - return null; - } - }); -} - -export function checkThumbnailTypeAndSendRequest(thumbnailUrl, productId) { - if (!thumbnailUrl.includes("/media/thumbnails")) { - return sendRequestForMediaThumbnails(thumbnailUrl, productId).then( - notCorrectStatus => notCorrectStatus, - ); - } else { - return sendRequestForThumbnails(thumbnailUrl, productId).then( - notCorrectStatus => notCorrectStatus, - ); - } -} - -export function iterateThroughThumbnails(productsWithThumbnails) { - const failedRequests = []; - productsWithThumbnails.forEach(product => { - const thumbnailUrl = product.node.thumbnail.url; - checkThumbnailTypeAndSendRequest(thumbnailUrl, product.node.id).then( - notCorrectStatus => { - if (notCorrectStatus) { - failedRequests.push(notCorrectStatus); - } - }, - ); - }); - return failedRequests; -} diff --git a/cypress/support/api/utils/shippingUtils.js b/cypress/support/api/utils/shippingUtils.js deleted file mode 100644 index 439a538c11d..00000000000 --- a/cypress/support/api/utils/shippingUtils.js +++ /dev/null @@ -1,115 +0,0 @@ -import { updateChannelWarehouses } from "../requests/Channels"; -import * as shippingMethodRequest from "../requests/ShippingMethod"; -import * as warehouseRequest from "../requests/Warehouse"; -import { getDefaultChannel } from "./channelsUtils"; - -export function createShipping({ - channelId, - name, - address, - price = 1, - minProductPrice = 0, - taxClassId, - slug, -}) { - let shippingMethod; - let shippingZone; - let warehouse; - - return warehouseRequest - .createWarehouse({ - name, - address, - slug, - }) - .then(warehouseResp => { - warehouse = warehouseResp; - - updateChannelWarehouses(channelId, warehouse.id); - shippingMethodRequest - .createShippingZone(name, address.country, channelId, warehouse.id) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - - shippingMethodRequest.createShippingRate({ - name, - shippingZone: shippingZone.id, - taxClassId, - }); - }); - }) - .then(({ shippingMethod: sippingMethodResp }) => { - shippingMethod = sippingMethodResp; - shippingMethodRequest.addChannelToShippingMethod( - shippingMethod.id, - channelId, - price, - minProductPrice, - ); - }) - .then(() => ({ shippingMethod, shippingZone, warehouse })); -} - -export function createShippingWithDefaultChannelAndAddress(name) { - let defaultChannel; - - return getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(fixtureAddresses => - createShipping({ - channelId: defaultChannel.id, - name, - address: fixtureAddresses.plAddress, - }), - ) - .then(({ shippingMethod, shippingZone, warehouse }) => ({ - shippingMethod, - shippingZone, - warehouse, - defaultChannel, - })); -} - -export function createShippingRate({ name, shippingZoneId }) { - return shippingMethodRequest - .createShippingRate({ name, shippingZone: shippingZoneId }) - .its("body.data.shippingPriceCreate.shippingMethod"); -} - -export function deleteShippingStartsWith(startsWith) { - cy.deleteElementsStartsWith( - shippingMethodRequest.deleteShippingZone, - shippingMethodRequest.getShippingZones, - startsWith, - ).deleteElementsStartsWith( - warehouseRequest.deleteWarehouse, - warehouseRequest.getWarehouses, - startsWith, - ); -} - -export function createShippingWithDefaultChannel(name, price) { - let defaultChannel; - - return getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: defaultChannel.id, - name, - address: addresses.usAddress, - price, - }); - }) - .then(({ shippingMethod, shippingZone }) => ({ - shippingMethod, - shippingZone, - defaultChannel, - })); -} diff --git a/cypress/support/api/utils/storeFront/checkoutUtils.js b/cypress/support/api/utils/storeFront/checkoutUtils.js deleted file mode 100644 index 2df72fe42f3..00000000000 --- a/cypress/support/api/utils/storeFront/checkoutUtils.js +++ /dev/null @@ -1,6 +0,0 @@ -export function isShippingAvailableInCheckout(checkout, shippingName) { - const shipping = checkout.shippingMethods.find( - element => element.name === shippingName - ); - return shipping !== undefined; -} diff --git a/cypress/support/api/utils/storeFront/storeFrontProductUtils.js b/cypress/support/api/utils/storeFront/storeFrontProductUtils.js deleted file mode 100644 index 4e9cbc5d23e..00000000000 --- a/cypress/support/api/utils/storeFront/storeFrontProductUtils.js +++ /dev/null @@ -1,37 +0,0 @@ -import { getProductDetails } from "../../requests/storeFront/ProductDetails"; - -export const isProductVisible = (resp, name) => { - const product = resp.body.data.product; - return product !== null && product.name === name; -}; - -export const isProductAvailableForPurchase = resp => { - const product = resp.body.data.product; - return product.isAvailableForPurchase; -}; - -export const isProductVisibleInSearchResult = (resp, productName) => { - const productsList = resp.body.data.products; - return ( - productsList.totalCount !== 0 && - productsList.edges[0].node.name === productName - ); -}; - -export const getProductVariants = (productId, channelSlug) => { - getProductDetails(productId, channelSlug).then(resp => { - const variantsList = resp.body.data.product.variants; - return variantsList.map(element => ({ - id: element.id, - name: element.name, - price: element.pricing.price.gross.amount, - currency: element.pricing.price.gross.currency, - })); - }); -}; - -export const getProductPrice = (productId, channelSlug) => { - getProductDetails(productId, channelSlug).then( - resp => resp.body.data.product.variants[0].pricing.price.gross.amount, - ); -}; diff --git a/cypress/support/api/utils/taxesUtils.js b/cypress/support/api/utils/taxesUtils.js deleted file mode 100644 index c4924747566..00000000000 --- a/cypress/support/api/utils/taxesUtils.js +++ /dev/null @@ -1,33 +0,0 @@ -import { - getTaxClassList, - getTaxConfigurationList, - updateTaxes, -} from "../requests/Taxes"; - -export function updateTaxConfigurationForChannel({ - channelSlug = "default-channel", - chargeTaxes = false, - taxCalculationStrategy = "FLAT_RATES", - pricesEnteredWithTax = "false", -}) { - getTaxConfigurationList().then(taxConfigurationList => { - const taxConfigurationForChannel = taxConfigurationList.find( - taxConfiguration => taxConfiguration.node.channel.slug === channelSlug, - ); - updateTaxes({ - id: taxConfigurationForChannel.node.id, - chargeTaxes, - taxCalculationStrategy, - pricesEnteredWithTax, - }); - }); -} - -export function getDefaultTaxClass() { - getTaxClassList().then(taxClassArray => { - const taxClass = taxClassArray.find( - taxClassItem => taxClassItem.node.name === "No Taxes", - ); - return taxClass.node; - }); -} diff --git a/cypress/support/api/utils/users.js b/cypress/support/api/utils/users.js deleted file mode 100644 index 98f3f849ffe..00000000000 --- a/cypress/support/api/utils/users.js +++ /dev/null @@ -1,176 +0,0 @@ -import { getPermissionsArray } from "../requests/Permissions"; -import { inviteStaffMember } from "../requests/StaffMembers"; - -export function inviteStaffMemberWithFirstPermission({ - email, - isActive = true, - firstName = "", - lastName = "", -}) { - return getPermissionsArray(1).then(permissions => { - inviteStaffMember({ - firstName, - lastName, - email, - isActive, - permissionId: permissions[0].node.id, - }); - }); -} - -/** - * Function mpGetMailsByRecipient first get all emails from mailpit with a timeout, and after that it finds email from recipient. - * It cloud happened that invite email from saleor has not been received yet, so in this case the action should be retried. - */ -export function getMailActivationLinkForUser(email, regex, i = 0) { - const serverStoredEmail = email.toLowerCase(); - - const urlRegex = regex ? regex : /\[\w*password\w*\]\(([^\)]*)/; - if (i > 3) { - throw new Error( - `There is no email invitation for user ${serverStoredEmail}`, - ); - } - return cy.mpGetMailsByRecipient(serverStoredEmail).then(mails => { - if (!mails.length) { - cy.wait(10000); - getMailActivationLinkForUser(serverStoredEmail, regex, i + 1); - } else { - cy.wrap(mails) - .mpLatest() - .should("not.eq", undefined) - .mpGetMailDetails() - .its("Text") - .then(body => { - const bodyWithoutWhiteSpaces = body.replace(/(\r\n|\n|\r|\s)/gm, ""); - return urlRegex.exec(bodyWithoutWhiteSpaces)[1]; - }); - } - }); -} - -export function getMailActivationLinkForUserAndSubject(email, subject, i = 0) { - const serverStoredEmail = email.toLowerCase(); - - if (i > 3) { - throw new Error( - `There is no email invitation for user ${serverStoredEmail}`, - ); - } - return cy.mpGetMailsByRecipient(serverStoredEmail).then(mails => { - if (!mails.length) { - cy.wait(10000); - getMailActivationLinkForUserAndSubject(serverStoredEmail, subject, i + 1); - } else { - cy.wrap(mails) - .mpGetMailsBySubject(subject) - .then(mailsWithSubject => { - if (!mailsWithSubject.length) { - cy.wait(10000); - getMailActivationLinkForUserAndSubject( - serverStoredEmail, - subject, - i + 1, - ); - } else { - cy.wrap(mailsWithSubject) - .mpLatest() - .should("not.eq", undefined) - .mpGetMailDetails() - .its("Text") - .then(body => { - const urlRegex = /\[\w*password\w*\]\(([^\)]*)/; - const bodyWithoutWhiteSpaces = body.replace( - /(\r\n|\n|\r|\s)/gm, - "", - ); - return urlRegex.exec(bodyWithoutWhiteSpaces)[1]; - }); - } - }); - } - }); -} - -export function getMailWithResetPasswordLink(email, subject, i = 0) { - const serverStoredEmail = email.toLowerCase(); - - if (i > 5) { - throw new Error( - `There is no email with reset password for user ${serverStoredEmail}`, - ); - } - return cy.mpGetMailsByRecipient(serverStoredEmail).then(mails => { - if (!mails.length) { - cy.wait(3000); - getMailWithResetPasswordLink(serverStoredEmail, subject, i + 1); - } else { - cy.mpGetMailsBySubject(subject).then(resetPasswordMails => { - if (!resetPasswordMails.length) { - cy.wait(3000); - getMailWithResetPasswordLink(serverStoredEmail, subject, i + 1); - } else { - cy.wrap(resetPasswordMails).mpLatest().mpGetMailDetails(); - } - }); - } - }); -} - -export function getMailsForUser(email, i = 0) { - const serverStoredEmail = email.toLowerCase(); - const getMailRetries = 9; - if (i > getMailRetries) { - throw new Error( - `There is no email invitation for user ${serverStoredEmail}`, - ); - } - return cy.mpGetMailsByRecipient(serverStoredEmail).then(mails => { - if (!mails.length) { - cy.wait(3000); - getMailsForUser(serverStoredEmail, i + 1); - } else { - return mails; - } - }); -} - -export function getMailWithGiftCardExportWithAttachment( - email, - subject, - attachmentFileType, - i = 0, -) { - if (i > 5) { - throw new Error(`There is no email Gift Card export for user ${email}`); - } - return cy.mpGetMailsByRecipient(email).then(mails => { - if (!mails.length) { - cy.wait(3000); - getMailWithGiftCardExportWithAttachment( - email, - subject, - attachmentFileType, - i + 1, - ); - } else { - cy.mpGetMailsBySubject(subject).then(mailsWithSubject => { - if (!mailsWithSubject.length) { - cy.wait(5000); - getMailWithGiftCardExportWithAttachment( - email, - subject, - attachmentFileType, - i + 1, - ); - } else { - cy.wrap(mailsWithSubject) - .mpLatest() - .mpGetMailDetails() - .should("not.eq", undefined) - .its("Text"); - } - }); - } - }); -} diff --git a/cypress/support/api/utils/warehouseUtils.js b/cypress/support/api/utils/warehouseUtils.js deleted file mode 100644 index e4fd2435d2a..00000000000 --- a/cypress/support/api/utils/warehouseUtils.js +++ /dev/null @@ -1,9 +0,0 @@ -import * as warehouseRequest from "../requests/Warehouse"; - -export function deleteWarehouseStartsWith(startsWith) { - cy.deleteElementsStartsWith( - warehouseRequest.deleteWarehouse, - warehouseRequest.getWarehouses, - startsWith, - ); -} diff --git a/cypress/support/customCommands/basicOperations/index.js b/cypress/support/customCommands/basicOperations/index.js deleted file mode 100644 index d8e409d612d..00000000000 --- a/cypress/support/customCommands/basicOperations/index.js +++ /dev/null @@ -1,64 +0,0 @@ -Cypress.Commands.add("getTextFromElement", element => - cy.get(element).invoke("text"), -); -Cypress.Commands.add("getRowSelectorWithNumber", rowNumber => - cy.get(`[data-value=${rowNumber}]`), -); - -Cypress.Commands.add("clearAndType", { prevSubject: true }, (subject, text) => { - cy.wrap(subject).then(subject => { - if (subject.find("[contenteditable]").length > 0) { - cy.wrap(subject).find("[contenteditable]").clear().type(text); - } else { - cy.wrap(subject).clear({ force: true }).type(text); - } - }); -}); -Cypress.Commands.add("clickOnElement", selector => { - cy.get(selector).click(); -}); - -Cypress.Commands.add("waitForRequestAndCheckIfNoErrors", alias => { - cy.wait(alias).then(resp => { - expect( - resp.response.body.errors, - `No errors in ${alias} operation in graphql response`, - ).to.be.undefined; - return resp; - }); -}); -Cypress.Commands.add("waitForRequestAndErrorMessage", (alias, error) => { - cy.wait(alias).then(resp => { - expect(resp.response.body.errors[0].message).to.contains(error); - return resp; - }); -}); - -Cypress.Commands.add("checkIfDataAreNotNull", data => { - expect(data, "Created data should not be null").to.be.not.null; - if (typeof data === "object") { - Object.keys(data).forEach(key => { - cy.checkIfDataAreNotNull(data[key]); - }); - } else if (Array.isArray(data)) { - expect(data).not.to.be.empty; - data.forEach(singleData => { - cy.checkIfDataAreNotNull(singleData); - }); - } -}); -Cypress.Commands.add("checkIfElementIsVisible", element => { - cy.get(element).should("be.visible"); -}); -Cypress.Commands.add("checkIfElementIsNotVisible", element => { - cy.get(element).should("not.be.visible"); -}); -Cypress.Commands.add("checkIfElementExist", element => { - cy.get(element).should("exist"); -}); -Cypress.Commands.add("checkIfElementNotExist", element => { - cy.get(element).should("not.exist"); -}); -Cypress.Commands.add("assertCanvasRowsNumber", (canvas, rowNumber) => { - cy.get(canvas).find("tr").should("have.length", rowNumber); -}); diff --git a/cypress/support/customCommands/basicOperations/mailpit.js b/cypress/support/customCommands/basicOperations/mailpit.js deleted file mode 100644 index af774a9aee0..00000000000 --- a/cypress/support/customCommands/basicOperations/mailpit.js +++ /dev/null @@ -1,64 +0,0 @@ -const mhApiUrl = path => { - const envValue = Cypress.env("MAILPITURL"); - const basePath = envValue ? envValue : Cypress.config("MAILPITURL"); - return `${basePath}/api${path}`; -}; - -/** - * Mail Collection - */ - -Cypress.Commands.add("mpGetAllMails", (fromLast = 60000) => - cy - .request({ - method: "GET", - url: mhApiUrl("/v1/messages?limit=100"), - }) - .then(response => { - // by default get mails received in last 60000ms - response.body.messages = response.body.messages.filter(message => { - const fiveMinutesAgo = Date.now() - fromLast; - const mailCreated = new Date(message.Created); - return mailCreated.getTime() > fiveMinutesAgo; - }); - if (typeof response.body === "string") { - return JSON.parse(response.body); - } else { - return response.body; - } - }), -); - -Cypress.Commands.add("mpLatest", { prevSubject: true }, mails => - Array.isArray(mails) && mails.length > 0 ? mails[0] : mails, -); - -Cypress.Commands.add("mpGetMailsBySubject", subject => { - cy.mpGetAllMails() - .its("messages") - .then(mails => mails.filter(mail => mail.Subject === subject)); -}); - -Cypress.Commands.add("mpGetMailsByRecipient", recipient => { - cy.mpGetAllMails() - .its("messages") - .then(mails => - mails.filter(mail => - mail.To.map(recipientObj => `${recipientObj.Address}`).includes( - recipient, - ), - ), - ); -}); - -Cypress.Commands.add("mpGetMailDetails", { prevSubject: true }, mail => - cy - .wrap(mail) - .then(mail => { - cy.request({ - method: "GET", - url: mhApiUrl(`/v1/message/${mail.ID}`), - }); - }) - .its("body"), -); diff --git a/cypress/support/customCommands/deleteElementsViaApi.js b/cypress/support/customCommands/deleteElementsViaApi.js deleted file mode 100644 index 44d046684b0..00000000000 --- a/cypress/support/customCommands/deleteElementsViaApi.js +++ /dev/null @@ -1,18 +0,0 @@ -Cypress.Commands.add( - "handleDeleteElement", - (element, deleteFunction, startsWith, name) => { - if (element.node[name].includes(startsWith)) { - deleteFunction(element.node.id); - } - } -); -Cypress.Commands.add( - "deleteElementsStartsWith", - (deleteFunction, getFunction, startsWith, name = "name") => { - getFunction(100, startsWith).then(elements => { - elements.forEach(element => { - cy.handleDeleteElement(element, deleteFunction, startsWith, name); - }); - }); - } -); diff --git a/cypress/support/customCommands/sharedElementsOperations/addressForm.js b/cypress/support/customCommands/sharedElementsOperations/addressForm.js deleted file mode 100644 index cf2eb344e0b..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/addressForm.js +++ /dev/null @@ -1,36 +0,0 @@ -import { ADDRESS_SELECTORS } from "../../../elements/shared/addressForm"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; - -Cypress.Commands.add("fillUpBasicAddress", address => { - cy.get(ADDRESS_SELECTORS.companyName) - .clearAndType(address.companyName) - .get(ADDRESS_SELECTORS.phone) - .clearAndType(address.phone) - .get(ADDRESS_SELECTORS.streetAddress1) - .clearAndType(address.streetAddress1) - .get(ADDRESS_SELECTORS.streetAddress2) - .clearAndType(address.streetAddress2) - .get(ADDRESS_SELECTORS.city) - .clearAndType(address.city) - .get(ADDRESS_SELECTORS.postalCode) - .clearAndType(address.postalCode) - .fillAutocompleteSelect(ADDRESS_SELECTORS.country, address.countryFullName) - .fillAutocompleteSelect( - ADDRESS_SELECTORS.countryArea, - address.countryAreaFullName, - ); -}); - -Cypress.Commands.add("fillUpAddressForm", address => { - cy.get(ADDRESS_SELECTORS.firstName) - .type(address.firstName) - .get(ADDRESS_SELECTORS.lastName) - .type(address.lastName) - .fillUpBasicAddress(address); -}); - -Cypress.Commands.add("fillUpAddressFormAndSubmit", address => { - cy.fillUpAddressForm(address) - .get(BUTTON_SELECTORS.submit) - .click(); -}); diff --git a/cypress/support/customCommands/sharedElementsOperations/assignElementsForm.js b/cypress/support/customCommands/sharedElementsOperations/assignElementsForm.js deleted file mode 100644 index 37c0594d53d..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/assignElementsForm.js +++ /dev/null @@ -1,17 +0,0 @@ -import { ASSIGN_ELEMENTS_SELECTORS } from "../../../elements/shared/assign-elements-selectors"; - -Cypress.Commands.add("assignElements", name => { - cy.get(ASSIGN_ELEMENTS_SELECTORS.tableRow) - .first() - .then(tableRow => { - cy.get(ASSIGN_ELEMENTS_SELECTORS.searchInput).type(name); - cy.wrap(tableRow).should(element => { - Cypress.dom.isDetached(element); - }); - cy.contains(ASSIGN_ELEMENTS_SELECTORS.tableRow, name) - .find(ASSIGN_ELEMENTS_SELECTORS.checkbox) - .click() - .get(ASSIGN_ELEMENTS_SELECTORS.submitButton) - .click(); - }); -}); diff --git a/cypress/support/customCommands/sharedElementsOperations/canvas.js b/cypress/support/customCommands/sharedElementsOperations/canvas.js deleted file mode 100644 index 921a317c01a..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/canvas.js +++ /dev/null @@ -1,62 +0,0 @@ -import { recurse } from "cypress-recurse"; -import pixelmatch from "pixelmatch"; - -export function ensureCanvasStatic(selector = "canvas") { - cy.log(`ensure the image in **${selector}** is static`); - const noLog = { log: false }; - - const delay = 300; // ms, when grabbing new image - - // take the current image - return cy - .get(selector, noLog) - .then($canvas => { - const ctx1 = $canvas[0].getContext("2d"); - const width = $canvas[0].width; - const height = $canvas[0].height; - let img1 = ctx1.getImageData(0, 0, width, height); - - // initial delay to make sure we catch updates - cy.wait(delay, noLog); - - return recurse( - () => - cy.get(selector, noLog).then($canvas => { - const ctx2 = $canvas[0].getContext("2d"); - const img2 = ctx2.getImageData(0, 0, width, height); - - const diff = ctx2.createImageData(width, height); - // number of different pixels - const number = pixelmatch( - img1.data, - img2.data, - diff.data, - width, - height, - { - threshold: 0.1, - }, - ); - - // for next comparison, use the new image - // as the base - this way we can get to the end - // of any animation - img1 = img2; - - return number; - }), - // predicate function - numberOfDifferentPixels => numberOfDifferentPixels < 10, - // recurse options - { - // by default uses the default command timeout - log: numberOfDifferentPixels => - cy.log(`**${numberOfDifferentPixels}** diff pixels`), - delay, - }, - ); - }) - .then(() => { - cy.log(`picture in **${selector}** is static`); - }); -} diff --git a/cypress/support/customCommands/sharedElementsOperations/confirmationMessages.js b/cypress/support/customCommands/sharedElementsOperations/confirmationMessages.js deleted file mode 100644 index 1a4f45ae1fe..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/confirmationMessages.js +++ /dev/null @@ -1,16 +0,0 @@ -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; - -Cypress.Commands.add("confirmationMessageShouldDisappear", () => { - cy.get(SHARED_ELEMENTS.notificationSuccess) - .should("be.visible") - .get(SHARED_ELEMENTS.notificationSuccess) - .should("not.exist"); -}); - -Cypress.Commands.add("confirmationMessageShouldAppear", () => { - cy.get(SHARED_ELEMENTS.notificationSuccess).should("be.visible"); -}); - -Cypress.Commands.add("confirmationErrorMessageShouldAppear", () => { - cy.get(SHARED_ELEMENTS.notificationFailure).should("be.visible"); -}); diff --git a/cypress/support/customCommands/sharedElementsOperations/deleteElement.js b/cypress/support/customCommands/sharedElementsOperations/deleteElement.js deleted file mode 100644 index 7f437f0bd52..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/deleteElement.js +++ /dev/null @@ -1,11 +0,0 @@ -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; - -Cypress.Commands.add("deleteElementWithReqAlias", alias => - cy - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest(alias) - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors(`@${alias}`) -); diff --git a/cypress/support/customCommands/sharedElementsOperations/progressBar.js b/cypress/support/customCommands/sharedElementsOperations/progressBar.js deleted file mode 100644 index e7674b55d61..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/progressBar.js +++ /dev/null @@ -1,13 +0,0 @@ -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; - -Cypress.Commands.add("visitAndWaitForProgressBarToDisappear", url => { - cy.visit(url).waitForProgressBarToNotBeVisible(); -}); - -Cypress.Commands.add("waitForProgressBarToNotBeVisible", () => { - cy.get(SHARED_ELEMENTS.progressBar).should("be.not.visible"); -}); - -Cypress.Commands.add("waitForProgressBarToNotExist", () => { - cy.get(SHARED_ELEMENTS.progressBar).should("not.exist"); -}); diff --git a/cypress/support/customCommands/sharedElementsOperations/selects.js b/cypress/support/customCommands/sharedElementsOperations/selects.js deleted file mode 100644 index 8c556fe9d4f..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/selects.js +++ /dev/null @@ -1,124 +0,0 @@ -import { DRAFT_ORDER_SELECTORS, PAGINATION } from "../../../elements"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { - selectorWithDataValue, - SHARED_ELEMENTS, -} from "../../../elements/shared/sharedElements"; - -Cypress.Commands.add("clickRowNumberButton", () => - cy.get(PAGINATION.rowNumberButton).click(), -); -Cypress.Commands.add("getRowNumberButton", () => - cy.get(PAGINATION.rowNumberButton), -); -Cypress.Commands.add("clickNextPagePaginationButton", () => - cy.get(PAGINATION.rowNumberButton), -); -Cypress.Commands.add("clickPrevPagePaginationButton", () => - cy.get(PAGINATION.previousPagePaginationButton), -); -Cypress.Commands.add("clickSubmitButton", () => - cy.get(BUTTON_SELECTORS.submit).click(), -); -Cypress.Commands.add("clickConfirmButton", () => - cy.get(BUTTON_SELECTORS.confirm).click(), -); -Cypress.Commands.add("clickFinalizeButton", () => - cy.get(DRAFT_ORDER_SELECTORS.finalizeButton).click(), -); -Cypress.Commands.add("openColumnPicker", () => - cy.get(SHARED_ELEMENTS.openColumnPickerButton).click(), -); - -Cypress.Commands.add("createNewOption", (selectSelector, newOption) => { - cy.get(selectSelector).type(newOption); - cy.contains(BUTTON_SELECTORS.selectOption, newOption) - .should("be.visible") - .click() - .get(selectSelector) - .find("input") - .first() - .click({ force: true }); -}); - -Cypress.Commands.add("fillNewMultiSelect", (selectSelector, option) => { - cy.fillAutocompleteSelect(selectSelector, option, true).then( - returnedOption => { - cy.get(SHARED_ELEMENTS.header) - .first() - .click({ force: true }) - .get(SHARED_ELEMENTS.multiselect.selectedOptions) - .should("be.visible"); - return cy.wrap(returnedOption); - }, - ); -}); - -Cypress.Commands.add("fillMultiSelect", (selectSelector, option) => { - cy.fillAutocompleteSelect(selectSelector, option, true).then( - returnedOption => { - cy.get(SHARED_ELEMENTS.header) - .first() - .click({ force: true }) - .get(SHARED_ELEMENTS.multiAutocomplete.selectedOptions) - .should("be.visible"); - return cy.wrap(returnedOption); - }, - ); -}); - -Cypress.Commands.add("fillBaseSelect", (selectSelector, value) => { - cy.get(selectSelector) - .should("not.have.attr", "aria-disabled", "true") - .click() - .get(selectorWithDataValue(value)) - .click(); -}); - -Cypress.Commands.add( - "fillAutocompleteSelect", - (selectSelector, option, isForce = false) => { - let selectedOption = option; - console.log("isForce", isForce); - cy.get(selectSelector) - .click(isForce ? { force: true } : undefined) - .get(BUTTON_SELECTORS.selectOption) - .should("be.visible"); - if (option) { - cy.get(BUTTON_SELECTORS.selectOption) - .first() - .then(detachedOption => { - cy.get(selectSelector).then(select => { - if (select.find("input").length > 0) { - cy.get(selectSelector) - .find("input") - .clear() - .type(option, { delay: 10 }); - } else { - cy.get(selectSelector).clear().type(option, { delay: 10 }); - } - }); - cy.wrap(detachedOption).should(det => { - Cypress.dom.isDetached(det); - }); - cy.contains(BUTTON_SELECTORS.selectOption, option) - .should("be.visible") - .click({ force: true }) - .then(() => selectedOption); - }); - } else { - cy.get(BUTTON_SELECTORS.selectOption) - .wait(1000) - .first() - .invoke("text") - .then(text => { - selectedOption = text; - }); - return cy - .get(BUTTON_SELECTORS.selectOption) - .first() - .click() - .then(() => selectedOption); - } - }, -); diff --git a/cypress/support/customCommands/sharedElementsOperations/tables.js b/cypress/support/customCommands/sharedElementsOperations/tables.js deleted file mode 100644 index cbcb2e210d2..00000000000 --- a/cypress/support/customCommands/sharedElementsOperations/tables.js +++ /dev/null @@ -1,71 +0,0 @@ -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; - -Cypress.Commands.add("searchInTable", query => { - cy.get(SHARED_ELEMENTS.searchInput) - .type(query) - .get(SHARED_ELEMENTS.progressBar) - .should("be.visible") - .waitForProgressBarToNotExist(); -}); - -// This command is searching for element/s on table, and then make an action on this element/s (select checkbox, or click) -// Before this command execute cy.addAliasToGraphRequest(), same alias pass as elementsGraphqlAlias parameter -// elementsName is for example "shippingZones", pass elements ids in array, or single element id in elementsIds -// action function is click or select checkbox on table with parameter id -Cypress.Commands.add( - "findElementsAndMakeActionOnTable", - ({ - elementsGraphqlAlias, - elementsName, - elementsIds, - counter = 0, - actionFunction - }) => { - cy.wait(`@${elementsGraphqlAlias}`) - .its("response.body") - .then(body => { - let shippingResults; - if (Array.isArray(body)) { - shippingResults = body.find(element => { - if (element.data[elementsName]) { - return element; - } - }); - } else { - shippingResults = body; - } - const shippingList = shippingResults.data[elementsName].edges; - const notSelectedElements = []; - elementsIds = Array.isArray(elementsIds) ? elementsIds : [elementsIds]; - elementsIds.forEach(id => { - const isShippingOnList = shippingList.find( - element => element.node.id === id - ); - if (isShippingOnList) { - actionFunction(id); - counter += 1; - } else { - notSelectedElements.push(id); - } - if (counter === elementsIds.length) { - return; - } - }); - if (counter === elementsIds.length) { - return; - } - cy.get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(BUTTON_SELECTORS.nextPaginationButton) - .click() - .findElementsAndMakeActionOnTable({ - elementsIds: notSelectedElements, - actionFunction, - counter, - elementsGraphqlAlias, - elementsName - }); - }); - } -); diff --git a/cypress/support/customCommands/softAssertions/index.js b/cypress/support/customCommands/softAssertions/index.js deleted file mode 100644 index ba708e5a719..00000000000 --- a/cypress/support/customCommands/softAssertions/index.js +++ /dev/null @@ -1,69 +0,0 @@ -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; - -Cypress.Commands.add("assertVisibility", selector => { - cy.get(selector).then( - element => expect(element, "element should be visible").to.be.visible, - ); -}); - -Cypress.Commands.add( - "expectCorrectBasicAddress", - (responseAddress, expectedAddress) => { - expect(responseAddress.city.toUpperCase()).to.eq( - expectedAddress.city.toUpperCase(), - ); - expect(responseAddress).to.have.property( - "countryArea", - expectedAddress.countryArea, - ); - expect(responseAddress).to.have.property("phone", expectedAddress.phone); - expect(responseAddress).to.have.property( - "postalCode", - expectedAddress.postalCode, - ); - expect(responseAddress).to.have.property( - "streetAddress1", - expectedAddress.streetAddress1, - ); - expect(responseAddress).to.have.property( - "streetAddress2", - expectedAddress.streetAddress2, - ); - }, -); - -Cypress.Commands.add( - "expectCorrectFullAddress", - (responseAddress, expectedAddress) => { - expect(responseAddress).to.have.property( - "firstName", - expectedAddress.firstName, - ); - expect(responseAddress).to.have.property( - "firstName", - expectedAddress.lastName, - ); - cy.expectCorrectBasicAddress(responseAddress, expectedAddress); - }, -); - -Cypress.Commands.add("expectSkeletonIsVisible", () => { - cy.get(SHARED_ELEMENTS.circularProgress).should("not.exist"); - cy.get(SHARED_ELEMENTS.progressBar).should("be.visible"); - cy.get("body").then($body => { - if ($body.find(SHARED_ELEMENTS.skeleton).length) { - cy.assertVisibility(SHARED_ELEMENTS.skeleton); - } else { - expect( - $body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length, - ).to.be.eq(1); - } - }); -}); - -Cypress.Commands.add("waitForSkeletonToDisappear", () => { - cy.get(SHARED_ELEMENTS.skeleton) - .should("be.visible") - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist"); -}); diff --git a/cypress/support/customCommands/user/index.js b/cypress/support/customCommands/user/index.js deleted file mode 100644 index 18717a28c6d..00000000000 --- a/cypress/support/customCommands/user/index.js +++ /dev/null @@ -1,57 +0,0 @@ -import "../../api/requests/utils/index"; - -import { LOGIN_SELECTORS } from "../../../elements/account/login-selectors"; -import { urlList } from "../../../fixtures/urlList"; -import { TEST_ADMIN_USER } from "../../../fixtures/users"; - -Cypress.Commands.add("loginUser", () => - cy - .get(LOGIN_SELECTORS.emailAddressInput) - .type(Cypress.env("USER_NAME")) - .get(LOGIN_SELECTORS.emailPasswordInput) - .type(Cypress.env("USER_PASSWORD"), { log: false }) - .get(LOGIN_SELECTORS.signInButton) - .click(), -); - -Cypress.Commands.add("loginInShop", () => { - cy.loginUserViaRequest("token"); -}); - -Cypress.Commands.add("visitHomePageLoggedViaApi", user => { - cy.addAliasToGraphRequest("UserDetails") - .loginUserViaRequest("auth", user) - .visit(urlList.homePage) - .waitForRequestAndCheckIfNoErrors("@UserDetails"); -}); - -Cypress.Commands.add( - "loginUserViaRequest", - (authorization = "auth", user = TEST_ADMIN_USER) => { - const mutation = `mutation TokenAuth{ - tokenCreate(email: "${user.email}", password: "${user.password}") { - token - refreshToken - errors: errors { - code - field - message - } - user { - id - } - } - }`; - return cy.sendRequestWithQuery(mutation, null).then(resp => { - window.localStorage.setItem( - "_saleorRefreshToken", - resp.body.data.tokenCreate.refreshToken, - ); - window.localStorage.setItem("notifiedAboutNavigator", "true"); - window.sessionStorage.setItem( - authorization, - resp.body.data.tokenCreate.token, - ); - }); - }, -); diff --git a/cypress/support/cypress-grep/index.d.ts b/cypress/support/cypress-grep/index.d.ts deleted file mode 100644 index 8e78771f2f8..00000000000 --- a/cypress/support/cypress-grep/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -declare namespace Cypress { - // specify additional properties in the TestConfig object - // in our case we will add "tags" property - interface TestConfigOverrides { - /** - * List of tags for this test - * @example a single tag - * it('logs in', { tags: '@smoke' }, () => { ... }) - * @example multiple tags - * it('works', { tags: ['@smoke', '@slow'] }, () => { ... }) - */ - tags?: string | string[]; - } - - interface Cypress { - grep?: (grep?: string, tags?: string, burn?: string) => void; - } -} diff --git a/cypress/support/cypress-grep/plugin.js b/cypress/support/cypress-grep/plugin.js deleted file mode 100644 index 45254fab14c..00000000000 --- a/cypress/support/cypress-grep/plugin.js +++ /dev/null @@ -1,137 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable no-console */ - -const debug = require("debug")("cypress-grep"); -const globby = require("globby"); -const { getTestNames } = require("find-test-names"); -const fs = require("fs"); -const { version } = 10; -const { resolveConfig, parseGrep, shouldTestRun } = require("./utils"); - -/** - * Prints the cypress-grep environment values if any. - * @param {Cypress.PluginConfigOptions} config - */ -function cypressGrepPlugin(config) { - if (!config || !config.env) { - return config; - } - - const { env } = config; - - debug("cypress-grep plugin version %s", version); - debug("Cypress config env object: %o", env); - - const grep = env.grep ? String(env.grep) : undefined; - if (grep) { - console.log('cypress-grep: tests with "%s" in their names', grep.trim()); - } - - const grepTags = env.grepTags || env["grep-tags"]; - if (grepTags) { - console.log('cypress-grep: filtering using tag(s) "%s"', grepTags); - const parsedGrep = parseGrep(null, grepTags); - debug("parsed grep tags %o", parsedGrep.tags); - } - - const grepBurn = env.grepBurn || env["grep-burn"] || env.burn; - if (grepBurn) { - console.log("cypress-grep: running filtered tests %d times", grepBurn); - } - const grepUntagged = env.grepUntagged || env["grep-untagged"]; - if (grepUntagged) { - console.log("cypress-grep: running untagged tests"); - } - - const omitFiltered = env.grepOmitFiltered || env["grep-omit-filtered"]; - if (omitFiltered) { - console.log("cypress-grep: will omit filtered tests"); - } - - const { resolvedConfig } = resolveConfig(config); - const { specPattern, excludeSpecPattern, integrationFolder } = resolvedConfig; - - const grepFilterSpecs = env.grepFilterSpecs === true; - if (grepFilterSpecs) { - debug(resolvedConfig); - const specFiles = globby.sync(specPattern, { - cwd: integrationFolder, - ignore: excludeSpecPattern, - absolute: true, - }); - debug("found %d spec files", specFiles.length); - debug("%o", specFiles); - let greppedSpecs = []; - if (grep) { - console.log( - 'cypress-grep: filtering specs using "%s" in the title', - grep, - ); - const parsedGrep = parseGrep(grep); - debug("parsed grep %o", parsedGrep); - greppedSpecs = specFiles.filter(specFile => { - const text = fs.readFileSync(specFile, { encoding: "utf8" }); - try { - const names = getTestNames(text); - const testAndSuiteNames = names.suiteNames.concat(names.testNames); - debug("spec file %s", specFile); - debug("suite and test names: %o", testAndSuiteNames); - - return testAndSuiteNames.some(name => { - const shouldRun = shouldTestRun(parsedGrep, name); - return shouldRun; - }); - } catch (err) { - debug(err.message); - debug(err.stack); - console.error("Could not determine test names in file: %s", specFile); - console.error("Will run it to let the grep filter the tests"); - return true; - } - }); - debug('found grep "%s" in %d specs', grep, greppedSpecs.length); - debug("%o", greppedSpecs); - } else if (grepTags) { - const parsedGrep = parseGrep(null, grepTags); - debug("parsed grep tags %o", parsedGrep); - greppedSpecs = specFiles.filter(specFile => { - const text = fs.readFileSync(specFile, { encoding: "utf8" }); - try { - const testInfo = getTestNames(text); - debug("spec file %s", specFile); - debug("test info: %o", testInfo.tests); - - return testInfo.tests.some(info => { - const shouldRun = shouldTestRun(parsedGrep, null, info.tags); - return shouldRun; - }); - } catch (err) { - console.error("Could not determine test names in file: %s", specFile); - console.error("Will run it to let the grep filter the tests"); - return true; - } - }); - debug('found grep tags "%s" in %d specs', grepTags, greppedSpecs.length); - debug("%o", greppedSpecs); - } - if (greppedSpecs.length) { - config.specPattern = greppedSpecs; - } else { - // hmm, we filtered out all specs, probably something is wrong - console.warn("grep and/or grepTags has eliminated all specs"); - if (grep) { - config.specPattern = "InvalidGrep"; - console.warn("grep: %s", grep); - console.error("Invalid grep, tests won't be executed"); - } - if (grepTags) { - console.warn("grepTags: %s", grepTags); - } - console.warn("Will leave all specs to run to filter at run-time"); - } - } - - return config; -} - -module.exports = cypressGrepPlugin; diff --git a/cypress/support/cypress-grep/support.js b/cypress/support/cypress-grep/support.js deleted file mode 100644 index cafdd1b1559..00000000000 --- a/cypress/support/cypress-grep/support.js +++ /dev/null @@ -1,217 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ - -const { parseGrep, shouldTestRun } = require("./utils"); -const version = 10; -const debug = require("debug")("cypress-grep"); -debug.log = console.info.bind(console); - -// preserve the real "it" function -const _it = it; -const _describe = describe; - -/** - * Wraps the "it" and "describe" functions that support tags. - * @see https://github.com/cypress-io/cypress-grep - */ -function cypressGrep() { - /** @type {string} Part of the test title go grep */ - let grep = Cypress.env("grep"); - if (grep) { - grep = String(grep).trim(); - } - - /** @type {string} Raw tags to grep string */ - const grepTags = Cypress.env("grepTags") || Cypress.env("grep-tags"); - - const burnSpecified = - Cypress.env("grepBurn") || Cypress.env("grep-burn") || Cypress.env("burn"); - - const grepUntagged = - Cypress.env("grepUntagged") || Cypress.env("grep-untagged"); - - if (!grep && !grepTags && !burnSpecified && !grepUntagged) { - // nothing to do, the user has no specified the "grep" string - debug("Nothing to grep, version %s", version); - return; - } - - /** @type {number} Number of times to repeat each running test */ - const grepBurn = - Cypress.env("grepBurn") || - Cypress.env("grep-burn") || - Cypress.env("burn") || - 1; - - /** @type {boolean} Omit filtered tests completely */ - const omitFiltered = - Cypress.env("grepOmitFiltered") || Cypress.env("grep-omit-filtered"); - - debug("grep %o", { grep, grepTags, grepBurn, omitFiltered, version }); - if (!Cypress._.isInteger(grepBurn) || grepBurn < 1) { - throw new Error(`Invalid grep burn value: ${grepBurn}`); - } - - const parsedGrep = parseGrep(grep, grepTags); - debug("parsed grep %o", parsedGrep); - - // prevent multiple registrations - // https://github.com/cypress-io/cypress-grep/issues/59 - if (it.name === "itGrep") { - debug("already registered cypress-grep"); - return; - } - - it = function itGrep(name, options, callback) { - if (typeof options === "function") { - // the test has format it('...', cb) - callback = options; - options = {}; - } - - if (!callback) { - // the pending test by itself - return _it(name, options); - } - - let configTags = options && options.tags; - if (typeof configTags === "string") { - configTags = [configTags]; - } - - const nameToGrep = suiteStack - .map(item => item.name) - .concat(name) - .join(" "); - const tagsToGrep = suiteStack - .flatMap(item => item.tags) - .concat(configTags) - .filter(Boolean); - - const shouldRun = shouldTestRun( - parsedGrep, - nameToGrep, - tagsToGrep, - grepUntagged, - ); - - if (tagsToGrep && tagsToGrep.length) { - debug( - 'should test "%s" with tags %s run? %s', - name, - tagsToGrep.join(","), - shouldRun, - ); - } else { - debug('should test "%s" run? %s', nameToGrep, shouldRun); - } - - if (shouldRun) { - if (grepBurn > 1) { - // repeat the same test to make sure it is solid - return Cypress._.times(grepBurn, k => { - const fullName = `${name}: burning ${k + 1} of ${grepBurn}`; - _it(fullName, options, callback); - }); - } - return _it(name, options, callback); - } - - if (omitFiltered) { - // omit the filtered tests completely - return; - } else { - // skip tests without grep string in their names - return _it.skip(name, options, callback); - } - }; - - // list of "describe" suites for the current test - // when we encounter a new suite, we push it to the stack - // when the "describe" function exits, we pop it - // Thus a test can look up the tags from its parent suites - const suiteStack = []; - - describe = function describeGrep(name, options, callback) { - if (typeof options === "function") { - // the block has format describe('...', cb) - callback = options; - options = {}; - } - - const stackItem = { name }; - suiteStack.push(stackItem); - - if (!callback) { - // the pending suite by itself - const result = _describe(name, options); - suiteStack.pop(); - return result; - } - - let configTags = options && options.tags; - if (typeof configTags === "string") { - configTags = [configTags]; - } - - if (!configTags || !configTags.length) { - // if the describe suite does not have explicit tags - // move on, since the tests inside can have their own tags - _describe(name, options, callback); - suiteStack.pop(); - return; - } - - // when looking at the suite of the tests, I found - // that using the name is quickly becoming very confusing - // and thus we need to use the explicit tags - stackItem.tags = configTags; - _describe(name, options, callback); - suiteStack.pop(); - - return; - }; - - // overwrite "context" which is an alias to "describe" - context = describe; - - // overwrite "specify" which is an alias to "it" - specify = it; - - // keep the ".skip", ".only" methods the same as before - it.skip = _it.skip; - it.only = _it.only; - // preserve "it.each" method if found - // https://github.com/cypress-io/cypress-grep/issues/72 - if (typeof _it.each === "function") { - it.each = _it.each; - } - - describe.skip = _describe.skip; - describe.only = _describe.only; - if (typeof _describe.each === "function") { - describe.each = _describe.each; - } -} - -function restartTests() { - setTimeout(() => { - window.top.document.querySelector(".reporter .restart").click(); - }, 0); -} - -if (!Cypress.grep) { - Cypress.grep = function grep(grep, tags, burn) { - Cypress.env("grep", grep); - Cypress.env("grepTags", tags); - Cypress.env("grepBurn", burn); - // remove any aliased values - Cypress.env("grep-tags", null); - Cypress.env("grep-burn", null); - Cypress.env("burn", null); - - debug('set new grep to "%o" restarting tests', { grep, tags, burn }); - restartTests(); - }; -} - -module.exports = cypressGrep; diff --git a/cypress/support/cypress-grep/utils.js b/cypress/support/cypress-grep/utils.js deleted file mode 100644 index a4ac16dde02..00000000000 --- a/cypress/support/cypress-grep/utils.js +++ /dev/null @@ -1,195 +0,0 @@ -// @ts-check - -// Universal code - should run in Node or in the browser - -/** - * Parses test title grep string. - * The string can have "-" in front of it to invert the match. - * @param {string} s Input substring of the test title - */ -function parseTitleGrep(s) { - if (!s || typeof s !== "string") { - return null; - } - - s = s.trim(); - if (s.startsWith("-")) { - return { - title: s.substring(1), - invert: true, - }; - } - return { - title: s, - invert: false, - }; -} - -function parseFullTitleGrep(s) { - if (!s || typeof s !== "string") { - return []; - } - - // separate each title - return s.split(";").map(parseTitleGrep); -} - -/** - * Parses tags to grep for. - * @param {string} s Tags string like "@tag1+@tag2" - */ -function parseTagsGrep(s) { - if (!s) { - return []; - } - - const explicitNotTags = []; - - // top level split - using space or comma, each part is OR - const ORS = s - .split(/[ ,]/) - // remove any empty tags - .filter(Boolean) - .map(part => { - // now every part is an AND - if (part.startsWith("--")) { - explicitNotTags.push({ - tag: part.slice(2), - invert: true, - }); - return; - } - const parsed = part.split("+").map(tag => { - if (tag.startsWith("-")) { - return { - tag: tag.slice(1), - invert: true, - }; - } else { - return { - tag, - invert: false, - }; - } - }); - - return parsed; - }); - - // filter out undefined from explicit not tags - const ORS_filtered = ORS.filter(x => x !== undefined); - if (explicitNotTags.length > 0) { - ORS_filtered.forEach((OR, index) => { - ORS_filtered[index] = OR.concat(explicitNotTags); - }); - } - return ORS_filtered; -} - -function shouldTestRunTags(parsedGrepTags, tags = []) { - if (!parsedGrepTags.length) { - // there are no parsed tags to search for, the test should run - return true; - } - - // now the test has tags and the parsed tags are present - - // top levels are OR - const onePartMatched = parsedGrepTags.some(orPart => { - const everyAndPartMatched = orPart.every(p => { - if (p.invert) { - return !tags.includes(p.tag); - } - - return tags.includes(p.tag); - }); - // console.log('every part matched %o?', orPart, everyAndPartMatched) - - return everyAndPartMatched; - }); - - // console.log('onePartMatched', onePartMatched) - return onePartMatched; -} - -function shouldTestRunTitle(parsedGrep, testName) { - if (!testName) { - // if there is no title, let it run - return true; - } - if (!parsedGrep) { - return true; - } - - if (!Array.isArray(parsedGrep)) { - console.error("Invalid parsed title grep"); - console.error(parsedGrep); - throw new Error("Expected title grep to be an array"); - } - - if (!parsedGrep.length) { - return true; - } - - const inverted = parsedGrep.filter(g => g.invert); - const straight = parsedGrep.filter(g => !g.invert); - - return ( - inverted.every(titleGrep => !testName.includes(titleGrep.title)) && - (!straight.length || - straight.some(titleGrep => testName.includes(titleGrep.title))) - ); -} - -// note: tags take precedence over the test name -function shouldTestRun(parsedGrep, testName, tags = [], grepUntagged = false) { - if (grepUntagged) { - return !tags.length; - } - - if (Array.isArray(testName)) { - // the caller passed tags only, no test name - tags = testName; - testName = undefined; - } - - return ( - shouldTestRunTitle(parsedGrep.title, testName) && - shouldTestRunTags(parsedGrep.tags, tags) - ); -} - -function parseGrep(titlePart, tags) { - return { - title: parseFullTitleGrep(titlePart), - tags: parseTagsGrep(tags), - }; -} - -function resolveConfig(config) { - const specPattern = config.specPattern || ""; - let excludeSpecPattern = config.excludeSpecPattern || ""; - if (typeof excludeSpecPattern === "string") { - excludeSpecPattern = [excludeSpecPattern]; - } - const integrationFolder = config.env.grepIntegrationFolder || process.cwd(); - - return { - resolvedConfig: { - specPattern, - excludeSpecPattern, - integrationFolder, - }, - }; -} - -module.exports = { - parseGrep, - parseTitleGrep, - parseFullTitleGrep, - parseTagsGrep, - resolveConfig, - shouldTestRun, - shouldTestRunTags, - shouldTestRunTitle, -}; diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js deleted file mode 100644 index dd5f411e509..00000000000 --- a/cypress/support/e2e.js +++ /dev/null @@ -1,205 +0,0 @@ -// / - -import "cypress-file-upload"; -import "./customCommands/basicOperations/mailpit"; -import "cypress-mochawesome-reporter/register"; -import "./customCommands/basicOperations"; -import "./customCommands/deleteElementsViaApi"; -import "./customCommands/sharedElementsOperations/addressForm.js"; -import "./customCommands/sharedElementsOperations/assignElementsForm.js"; -import "./customCommands/sharedElementsOperations/confirmationMessages.js"; -import "./customCommands/sharedElementsOperations/deleteElement"; -import "./customCommands/sharedElementsOperations/progressBar.js"; -import "./customCommands/sharedElementsOperations/selects.js"; -import "./customCommands/sharedElementsOperations/tables"; -import "./customCommands/softAssertions"; -import "./customCommands/user"; - -import { commandTimings } from "cypress-timings"; -import addContext from "mochawesome/addContext"; - -import { - BUTTON_SELECTORS, - CATEGORY_DETAILS_SELECTORS, - SHARED_ELEMENTS, -} from "../elements"; -import { urlList } from "../fixtures/urlList"; -import { ensureCanvasStatic } from "../support/customCommands/sharedElementsOperations/canvas"; -import cypressGrep from "../support/cypress-grep/support"; - -commandTimings(); -cypressGrep(); - -Cypress.Commands.add("clearSessionData", () => { - cy.clearCookies(); - cy.clearLocalStorage(); - window.sessionStorage.clear(); -}); - -Cypress.Commands.add("addAliasToGraphRequest", operationName => { - cy.intercept("POST", urlList.apiUri, req => { - req.statusCode = 200; - const requestBody = req.body; - if (Array.isArray(requestBody)) { - requestBody.forEach(element => { - if (element.operationName === operationName) { - req.alias = operationName; - } - }); - } else { - if (requestBody.operationName === operationName) { - req.alias = operationName; - } - } - }); -}); - -Cypress.Commands.add( - "addAliasToGraphRequestAndUseMockedResponseBody", - (operationName, bodyMock) => { - cy.intercept("POST", urlList.apiUri, req => { - req.statusCode = 200; - const requestBody = req.body; - if (Array.isArray(requestBody)) { - requestBody.forEach(element => { - if (element.operationName === operationName) { - req.alias = operationName; - req.reply({ - body: bodyMock, - }); - } - }); - } else { - if (requestBody.operationName === operationName) { - req.alias = operationName; - req.reply({ - body: bodyMock, - }); - } - } - }); - }, -); - -Cypress.Commands.add("getGridCellInfo", (col, row) => - /* - It seeks for react fiber node to obtain Glide grid instance. - Within its ref, we have getBounds API which returns an info about given cell. - - Browsing over the three starts from canvas. In case of changing that selector, - this function must be adjusted as well. - */ - cy - .get(SHARED_ELEMENTS.dataGridTable) - .should("be.visible") - .wait(3000) - .then(node => { - const fiberKey = Object.keys(node[0]).find(x => - x.includes("__reactFiber"), - ); - - const bounds = node[0].parentNode[ - fiberKey - ].pendingProps.children.props.gridRef.current.getBounds(col, row); - - return { - ...bounds, - center: { - x: bounds.x + bounds.width / 2, - y: bounds.y + bounds.height / 2, - }, - }; - }), -); - -Cypress.Commands.add("clickGridCell", (col, row) => { - cy.getGridCellInfo(col, row).then(bounds => { - cy.get("body").click(bounds.center.x, bounds.center.y); - }); -}); - -Cypress.Commands.add("clickGridHeader", col => { - cy.getGridCellInfo(col, 0).then(bounds => { - const headerXCenter = bounds.x + bounds.width / 2; - const headerYCenter = bounds.y - bounds.height / 2; - - cy.get("body").click(headerXCenter, headerYCenter); - }); -}); -Cypress.Commands.add( - "deleteTwoFirstRecordsFromGridListAndValidate", - deleteRequestName => { - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.get(SHARED_ELEMENTS.firstRowDataGrid) - .invoke("text") - .then(firstOnListCollectionName => { - cy.get(SHARED_ELEMENTS.secondRowDataGrid) - .invoke("text") - .then(secondOnListCollectionName => { - // check two first rows on list view - cy.clickGridCell(0, 0); - cy.clickGridCell(0, 1); - - cy.get(CATEGORY_DETAILS_SELECTORS.deleteCategoriesButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors(`@${deleteRequestName}`); - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - - cy.contains( - SHARED_ELEMENTS.dataGridTable, - firstOnListCollectionName, - ).should("not.exist"); - cy.contains( - SHARED_ELEMENTS.dataGridTable, - secondOnListCollectionName, - ).should("not.exist"); - }); - }); - }, -); -Cypress.Commands.add( - "deleteFirstRecordFromGridListAndValidate", - (expectedName, deleteRequestName, listRequestName) => { - ensureCanvasStatic(SHARED_ELEMENTS.dataGridTable); - cy.get(SHARED_ELEMENTS.firstRowDataGrid) - .invoke("text") - .then(firstOnListName => { - expect(expectedName).to.eq(firstOnListName); - cy.clickGridCell(0, 0); - cy.get(CATEGORY_DETAILS_SELECTORS.deleteCategoriesButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors(`@${deleteRequestName}`) - .waitForRequestAndCheckIfNoErrors(`@${listRequestName}`); - cy.contains(SHARED_ELEMENTS.dataGridTable, firstOnListName).should( - "not.exist", - ); - }); - }, -); - -Cypress.on( - "uncaught:exception", - (_err, _runnable) => - // returning false here prevents Cypress from - // failing the test - false, -); - -const titleToFileName = title => title.replace(/[:\/]/g, ""); - -Cypress.on("test:after:run", (test, runnable) => { - if (test.state === "failed") { - let parent = runnable.parent; - let filename = ""; - while (parent && parent.title) { - filename = `${titleToFileName(parent.title)} -- ${filename}`; - parent = parent.parent; - } - filename += `${titleToFileName(test.title)} (failed).png`; - addContext({ test }, `mochareports/${Cypress.spec.name}/${filename}`); - } -}); diff --git a/cypress/support/filterTests.js b/cypress/support/filterTests.js deleted file mode 100644 index 3d087b95a7e..00000000000 --- a/cypress/support/filterTests.js +++ /dev/null @@ -1,39 +0,0 @@ -// / -/** - * Filter Cypress tests based on a given tag or tags. If no tags are present, run tests. - * - * @param {[string]} definedTags An array of tags - * @param {Function} runTest All tests captured within a Cypress run - * @example npm run open --env tags=api - * version: - * dev -run all - * 3.1 -run eq or lower than 3.1 - */ - -const filterTests = ({ definedTags = ["all"], version = "1.0.0" }, runTest) => { - let isTestAvailableInVersion = false; - const shopVersion = Cypress.env("SHOP"); - if (shopVersion === "dev") { - isTestAvailableInVersion = true; - } else { - const tagVersion = version.match("^\\d\\.\\d\\.\\d")[0].replaceAll(".", ""); - const numberVersion = shopVersion - .match("^\\d\\.\\d\\.\\d")[0] - .replaceAll(".", ""); - if (tagVersion <= numberVersion) { - isTestAvailableInVersion = true; - } - } - if (Cypress.env("tags")) { - const tags = Cypress.env("tags").split("/"); - const isFound = definedTags.some($definedTag => tags.includes($definedTag)); - - if (isFound && isTestAvailableInVersion) { - runTest(); - } - } else if (isTestAvailableInVersion) { - runTest(); - } -}; - -export default filterTests; diff --git a/cypress/support/formatData/dataDependingOnVersion.js b/cypress/support/formatData/dataDependingOnVersion.js deleted file mode 100644 index 1660ce39623..00000000000 --- a/cypress/support/formatData/dataDependingOnVersion.js +++ /dev/null @@ -1,10 +0,0 @@ -export function returnValueDependsOnShopVersion( - version, - equalOrGreaterValue, - lessThenValue = "" -) { - return Cypress.env("SHOP") === "dev" || - Cypress.env("SHOP").replaceAll(".", "") >= version.replaceAll(".", "") - ? equalOrGreaterValue - : lessThenValue; -} diff --git a/cypress/support/formatData/formatCurrencyAmount.js b/cypress/support/formatData/formatCurrencyAmount.js deleted file mode 100644 index 2c470969f8d..00000000000 --- a/cypress/support/formatData/formatCurrencyAmount.js +++ /dev/null @@ -1,11 +0,0 @@ -export function getFormattedCurrencyAmount(amount, currency) { - const language = window.navigator.userLanguage || window.navigator.language; - return amount.toLocaleString(language, { - currency, - style: "currency" - }); -} - -export function getCurrencyAndAmountInString(amount, currency) { - return `${currency}${amount.toFixed(2)}`; -} diff --git a/cypress/support/formatData/formatDate.js b/cypress/support/formatData/formatDate.js deleted file mode 100644 index 2a2644553a7..00000000000 --- a/cypress/support/formatData/formatDate.js +++ /dev/null @@ -1,20 +0,0 @@ -export function formatDate(date) { - const day = getPeriodValue(date, { day: "2-digit" }); - const month = getPeriodValue(date, { month: "2-digit" }); - const year = getPeriodValue(date, { year: "numeric" }); - - return new Array(year, month, day).join("-"); -} - -function getPeriodValue(date, option) { - const formatter = new Intl.DateTimeFormat("en-us", option); - return formatter.format(date); -} - -export function formatTime(date) { - const hour = getPeriodValue(date, { hour: "2-digit", hour12: false }); - const minute = getPeriodValue(date, { minute: "2-digit" }); - const formattedMinute = minute.length === 1 ? `0${minute}` : minute; - - return new Array(hour, formattedMinute).join(":"); -} diff --git a/cypress/support/formatData/formatJson.js b/cypress/support/formatData/formatJson.js deleted file mode 100644 index 6b9f30bafeb..00000000000 --- a/cypress/support/formatData/formatJson.js +++ /dev/null @@ -1,12 +0,0 @@ -export function stringify(obj_from_json) { - if (typeof obj_from_json !== "object" || Array.isArray(obj_from_json)) { - // not an object, stringify using native function - return JSON.stringify(obj_from_json); - } - // Implements recursive object serialization according to JSON spec - // but without quotes around the keys. - const props = Object.keys(obj_from_json) - .map(key => `${key}:${stringify(obj_from_json[key])}`) - .join(","); - return `{${props}}`; -} diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts deleted file mode 100644 index e8ffed3e8da..00000000000 --- a/cypress/support/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -declare namespace Cypress { - interface Chainable { - clearSessionData(): Chainable; - handleDeleteElement( - element: {}, - deleteFunction: function, - startsWith: string, - name: string, - ): Chainable; - deleteElementsStartsWith( - deleteFunction: function, - getFunction: function, - startsWith: string, - name? = string, - ): Chainable; - expectCorrectFullAddress( - responseAddress: string, - expectedAddress: string, - ): Chainable; - expectCorrectBasicAddress( - responseAddress: string, - expectedAddress: string, - ): Chainable; - getTextFromElement(element: {}): Chainable; - clearAndType(subject: {}, text: string): Chainable; - loginUser(): Chainable; - loginInShop(): Chainable; - loginUserViaRequest(authorization?: string, user?: {}): Chainable; - assignElements(name: string, withLoader?: boolean): Chainable; - fillUpAddressFormAndSubmit(address: {}): Chainable; - fillUpAddressForm(address: {}): Chainable; - fillUpBasicAddress(address: {}): Chainable; - confirmationMessageShouldDisappear(): Chainable; - confirmationMessageShouldAppear(): Chainable; - waitForProgressBarToNotExist(): Chainable; - waitForProgressBarToNotBeVisible(): Chainable; - visitAndWaitForProgressBarToDisappear(url: string): Chainable; - fillBaseSelect(selectSelector: string, value: string): Chainable; - fillAutocompleteSelect( - selectSelector: string, - option?: string, - isForce?: boolean, - ): Chainable; - addAliasToGraphRequest(alias: string): Chainable; - sendRequestWithQuery(query: string): Chainable; - fillMultiSelect(selectSelector: string, option: string): Chainable; - fillNewMultiSelect(selectSelector: string, option: string): Chainable; - createNewOption(selectSelector: string, newOption: string): Chainable; - findElementsAndMakeActionOnTable({ - elementsGraphqlAlias: string, - elementsName: string, - elementsIds: string, - actionFunction, - }): Chainable; - searchInTable(query: string): Chainable; - waitForRequestAndCheckIfNoErrors(alias: string): Chainable; - deleteElementWithReqAlias(alias: string): Chainable; - } -} diff --git a/cypress/support/pages/attributesPage.js b/cypress/support/pages/attributesPage.js deleted file mode 100644 index ddbf4a19b6b..00000000000 --- a/cypress/support/pages/attributesPage.js +++ /dev/null @@ -1,127 +0,0 @@ -import { ATTRIBUTES_DETAILS } from "../../elements/attribute/attributes_details"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { attributeDetailsUrl } from "../../fixtures/urlList"; - -export function createAttributeWithInputType({ - name, - attributeType, - entityType, - numericSystemType, - swatchImage, - valueRequired = true, -}) { - fillUpAttributeCreateFields({ name, attributeType, valueRequired }); - if ( - attributeType === "DROPDOWN" || - attributeType === "MULTISELECT" || - (attributeType === "SWATCH" && !swatchImage) - ) { - addSingleValue(name); - } - if (attributeType === "REFERENCE") { - selectEntityType(entityType); - } - if (attributeType === "NUMERIC" && numericSystemType.unitsOf) { - selectNumericSystem(numericSystemType); - } - if (attributeType === "SWATCH" && swatchImage) { - selectSwatchImage(name, swatchImage); - } - return saveAttribute(); -} - -export function fillUpAttributeCreateFields({ - name, - attributeType, - valueRequired, -}) { - fillUpAttributeNameAndCode(name); - cy.get(ATTRIBUTES_DETAILS.inputTypeSelect) - .click() - .get(ATTRIBUTES_DETAILS.attributesInputTypes[attributeType]) - .click(); - if (!valueRequired) { - cy.get(ATTRIBUTES_DETAILS.valueRequired).click(); - } -} - -export function fillUpAttributeNameAndCode(name, code = name) { - return cy - .get(ATTRIBUTES_DETAILS.nameInput) - .clear() - .type(name) - .get(ATTRIBUTES_DETAILS.codeInput) - .clear() - .type(code); -} - -export function saveAttribute() { - cy.addAliasToGraphRequest("AttributeCreate"); - submitAttribute(); - return cy - .waitForRequestAndCheckIfNoErrors("@AttributeCreate") - .its("response.body.data.attributeCreate"); -} - -export function submitAttribute() { - cy.get(BUTTON_SELECTORS.confirm).click().confirmationMessageShouldDisappear(); -} - -export function addSingleValue(valueName) { - cy.get(ATTRIBUTES_DETAILS.assignValuesButton) - .click() - .get(ATTRIBUTES_DETAILS.valueNameInput) - .type(valueName) - .get(BUTTON_SELECTORS.submit) - .click(); -} - -export function selectEntityType(entityType) { - cy.get(ATTRIBUTES_DETAILS.entityTypeSelect) - .click() - .get(ATTRIBUTES_DETAILS.entityTypeOptions[entityType]) - .click(); -} - -export function selectNumericSystem({ unitSystem, unitsOf, unit }) { - cy.get(ATTRIBUTES_DETAILS.selectUnitCheckbox) - .click() - .get(ATTRIBUTES_DETAILS.unitSystemSelect) - .click() - .get(ATTRIBUTES_DETAILS.unitSystemsOptions[unitSystem]) - .click() - .get(ATTRIBUTES_DETAILS.unitOfSelect) - .click() - .get(ATTRIBUTES_DETAILS.unitsOfOptions[unitsOf]) - .click() - .get(ATTRIBUTES_DETAILS.unitSelect) - .click() - .get(ATTRIBUTES_DETAILS.unitsOptions[unit]) - .click(); -} - -export function enterAttributeAndChanegeIsFilterableInDashbord(attributeId) { - cy.visit(attributeDetailsUrl(attributeId)) - .waitForProgressBarToNotBeVisible() - .get(ATTRIBUTES_DETAILS.dashboardProperties.useInFilteringCheckbox) - .click(); - submitAttribute(); -} - -export function selectSwatchImage(valueName, image) { - cy.get(ATTRIBUTES_DETAILS.assignValuesButton) - .click() - .get(ATTRIBUTES_DETAILS.valueNameInput) - .type(valueName) - .get(ATTRIBUTES_DETAILS.imageCheckbox) - .click() - .get(ATTRIBUTES_DETAILS.uploadFileButton) - .click() - .get(SHARED_ELEMENTS.fileInput) - .attachFile(image) - .get(ATTRIBUTES_DETAILS.uploadFileButton) - .should("be.enabled") - .get(BUTTON_SELECTORS.submit) - .click(); -} diff --git a/cypress/support/pages/catalog/categoriesPage.js b/cypress/support/pages/catalog/categoriesPage.js deleted file mode 100644 index 4eaa5afcd3a..00000000000 --- a/cypress/support/pages/catalog/categoriesPage.js +++ /dev/null @@ -1,35 +0,0 @@ -import { CATEGORY_DETAILS_SELECTORS } from "../../../elements/catalog/categories/category-details"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; - -export function createCategory({ name, description }) { - fillUpCategoryGeneralInfo({ name, description }); - return saveCategory(); -} - -export function updateCategory({ name, description }) { - fillUpCategoryGeneralInfo({ name, description }); - return saveCategory("CategoryUpdate"); -} - -export function fillUpCategoryGeneralInfo({ name, description }) { - return cy - .get(CATEGORY_DETAILS_SELECTORS.nameInput) - .clearAndType(name) - .get(CATEGORY_DETAILS_SELECTORS.descriptionInput) - .find(SHARED_ELEMENTS.contentEditable) - .should("be.visible") - - .get(CATEGORY_DETAILS_SELECTORS.descriptionInput) - .click() - .get(CATEGORY_DETAILS_SELECTORS.descriptionInput) - .clearAndType(description); -} - -export function saveCategory(alias = "CategoryCreate") { - return cy - .addAliasToGraphRequest(alias) - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors(`@${alias}`); -} diff --git a/cypress/support/pages/catalog/collectionsPage.js b/cypress/support/pages/catalog/collectionsPage.js deleted file mode 100644 index 01267fc7dce..00000000000 --- a/cypress/support/pages/catalog/collectionsPage.js +++ /dev/null @@ -1,76 +0,0 @@ -import { COLLECTION_SELECTORS } from "../../../elements/catalog/collection-selectors"; -import { AVAILABLE_CHANNELS_FORM } from "../../../elements/channels/available-channels-form"; -import { SELECT_CHANNELS_TO_ASSIGN } from "../../../elements/channels/select-channels-to-assign"; -import { ASSIGN_ELEMENTS_SELECTORS } from "../../../elements/shared/assign-elements-selectors"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; - -export function createCollection(collectionName, isPublished, channel) { - const publishedSelector = isPublished - ? AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue - : AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse; - - cy.get(COLLECTION_SELECTORS.createCollectionButton) - .click() - .get(COLLECTION_SELECTORS.nameInput) - .type(collectionName) - .get(AVAILABLE_CHANNELS_FORM.manageChannelsButton) - .click() - .get(SELECT_CHANNELS_TO_ASSIGN.allChannelsCheckbox) - .click(); - cy.contains(SELECT_CHANNELS_TO_ASSIGN.channelRow, channel.name) - .find(SELECT_CHANNELS_TO_ASSIGN.channelCheckbox) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .get(AVAILABLE_CHANNELS_FORM.availableChannel) - .click() - .get(`${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${publishedSelector}`) - .first() - .click(); - return saveCollection().its("response.body.data.collectionCreate.collection"); -} -export function saveCollection(alias = "CreateCollection") { - return cy - .addAliasToGraphRequest(alias) - .get(COLLECTION_SELECTORS.saveButton) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors(`@${alias}`); -} - -export function updateCollection({ name, description }) { - cy.get(COLLECTION_SELECTORS.nameInput) - .should("be.enabled") - .get(COLLECTION_SELECTORS.descriptionInput) - .find(COLLECTION_SELECTORS.placeholder) - .type(description) - .get(COLLECTION_SELECTORS.nameInput) - .clearAndType(name); - return saveCollection("CollectionUpdate"); -} - -export function assignProductsToCollection(productName) { - cy.waitForProgressBarToNotBeVisible() - .get(COLLECTION_SELECTORS.addProductButton) - .click() - .addAliasToGraphRequest("SearchProducts") - .get(ASSIGN_ELEMENTS_SELECTORS.searchInput) - .type(productName) - .waitForRequestAndCheckIfNoErrors("@SearchProducts"); - cy.contains(ASSIGN_ELEMENTS_SELECTORS.tableRow, productName) - .find(ASSIGN_ELEMENTS_SELECTORS.checkbox) - .click(); - cy.addAliasToGraphRequest("CollectionAssignProduct"); - cy.get(ASSIGN_ELEMENTS_SELECTORS.submitButton).click(); - cy.waitForRequestAndCheckIfNoErrors("@CollectionAssignProduct"); -} - -export function removeProductsFromCollection(productName) { - cy.contains(ASSIGN_ELEMENTS_SELECTORS.tableRow, productName) - .find(ASSIGN_ELEMENTS_SELECTORS.checkbox) - .click() - .addAliasToGraphRequest("UnassignCollectionProduct") - .get(BUTTON_SELECTORS.deleteIcon) - .click() - .waitForRequestAndCheckIfNoErrors("@UnassignCollectionProduct"); -} diff --git a/cypress/support/pages/catalog/giftCardPage.js b/cypress/support/pages/catalog/giftCardPage.js deleted file mode 100644 index 81f03705cac..00000000000 --- a/cypress/support/pages/catalog/giftCardPage.js +++ /dev/null @@ -1,141 +0,0 @@ -import { SHARED_ELEMENTS } from "../../../elements"; -import { GIFT_CARD_DIALOG } from "../../../elements/catalog/giftCard/giftCardDialog"; -import { - GIFT_CARD_LIST, - giftCardRow, -} from "../../../elements/catalog/giftCard/giftCardList"; -import { GIFT_CARD_SHOW_MORE } from "../../../elements/catalog/giftCard/giftCardShowMore"; -import { GIFT_CARD_UPDATE } from "../../../elements/catalog/giftCard/giftCardUpdate"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { giftCardDetailsUrl, urlList } from "../../../fixtures/urlList"; - -export function openAndFillUpCreateGiftCardDialog({ - note, - tag, - amount, - currency, -}) { - cy.visit(urlList.giftCards) - .get(GIFT_CARD_LIST.issueCardButton) - .click() - .get(GIFT_CARD_DIALOG.currencySelectButton) - .click(); - cy.contains(GIFT_CARD_DIALOG.currenciesOptions, currency) - .click() - .get(GIFT_CARD_DIALOG.amountInput) - .clearAndType(amount) - .createNewOption(GIFT_CARD_DIALOG.tagInput, tag) - .get(GIFT_CARD_DIALOG.noteInput) - .type(note); -} - -export function saveGiftCard() { - return cy - .addAliasToGraphRequest("GiftCardCreate") - .get(BUTTON_SELECTORS.submit) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@GiftCardCreate") - .its("response.body.data.giftCardCreate.giftCard"); -} - -export const expiryPeriods = { - MONTH: GIFT_CARD_DIALOG.expirationOptions.expiryPeriodMonthType, -}; - -export function setExpiryPeriod(amount, period) { - cy.get(GIFT_CARD_DIALOG.expirationOptions.setExpiryDateCheckbox) - .click() - .get(GIFT_CARD_DIALOG.expirationOptions.expiryPeriodRadioButton) - .click() - .get(GIFT_CARD_DIALOG.expirationOptions.expiryPeriodAmount) - .clearAndType(amount) - .get(GIFT_CARD_DIALOG.expirationOptions.expiryPeriodTypeButton) - .click() - .get(period) - .click(); -} - -export function setExpiryDate(date) { - cy.get(GIFT_CARD_DIALOG.expirationOptions.setExpiryDateCheckbox) - .click() - .get(GIFT_CARD_DIALOG.expirationOptions.expiryDateRadioButton) - .click() - .get(GIFT_CARD_DIALOG.expirationOptions.expiryDateInput) - .type(date); -} - -export function changeGiftCardActiveStatus(giftCardId) { - cy.visit(giftCardDetailsUrl(giftCardId)) - .get(GIFT_CARD_UPDATE.changeActiveStatusButton) - .click() - .confirmationMessageShouldAppear(); -} - -export function selectGiftCard(giftCardId) { - return cy - .get(giftCardRow(giftCardId)) - .find(GIFT_CARD_LIST.selectGiftCardCheckbox) - .click(); -} -export function selectGiftCardOnListView(giftCardCode) { - const splitCode = giftCardCode.split("-"); - const lastCodeElement = splitCode.slice(-1).toString(); - cy.log(lastCodeElement); - return cy - .contains( - `${SHARED_ELEMENTS.dataGridTable} table tbody tr`, - lastCodeElement, - ) - .invoke("index") - .then(index => { - cy.clickGridCell(0, index); - }); -} - -export function enterAndSelectGiftCards(giftCardsIds) { - const alias = "GiftCardList"; - cy.addAliasToGraphRequest(alias) - .visit(urlList.giftCards) - .findElementsAndMakeActionOnTable({ - elementsGraphqlAlias: alias, - elementsName: "giftCards", - elementsIds: giftCardsIds, - actionFunction: selectGiftCard, - }); -} -export function openExportGiftCardsDialog() { - cy.get(BUTTON_SELECTORS.showMoreButton) - .click({ force: true }) - .get(GIFT_CARD_SHOW_MORE.exportCodesMenu) - .click(); -} -export function selectSelectedRecordsButton() { - cy.get(GIFT_CARD_SHOW_MORE.exportSelectedRecords).click(); -} -export function selectExportAsCSVButton() { - cy.get(GIFT_CARD_SHOW_MORE.exportAsRadioBtn.csv).click(); -} -export function selectExportAsXLSXButton() { - cy.get(GIFT_CARD_SHOW_MORE.exportAsRadioBtn.xlsx).click(); -} -export function clickDeactivateButton() { - cy.get(GIFT_CARD_LIST.deactivateGiftCardButton).click(); -} -export function bulkDeleteRecords() { - cy.get(BUTTON_SELECTORS.bulkDeleteButton) - .click() - .get(GIFT_CARD_UPDATE.consentCheckbox) - .click() - .get(BUTTON_SELECTORS.submit) - .click(); -} -export function getUrlWithFilteredTags(url, tagsArray) { - const urlHelper = url + "?asc=true&sort=usedBy"; - let tagsPath = ""; - tagsArray.forEach((tag, index) => { - tagsPath += `&tag%5B${index}%5D=${tag}`; - }); - return urlHelper + tagsPath; -} diff --git a/cypress/support/pages/catalog/metadataComponent.js b/cypress/support/pages/catalog/metadataComponent.js deleted file mode 100644 index fcc399538a3..00000000000 --- a/cypress/support/pages/catalog/metadataComponent.js +++ /dev/null @@ -1,139 +0,0 @@ -import { METADATA_FORM } from "../../../elements/shared/metadata/metadata-form"; - -export const metadataForms = { - private: METADATA_FORM.privateMetadataForm, - public: METADATA_FORM.metadataForm, -}; - -export function addMetadataField({ metadataForm, name, value }) { - return cy - .get(metadataForm) - .find(METADATA_FORM.addFieldButton) - .click() - .get(metadataForm) - .find(METADATA_FORM.nameInput) - .type(name) - .get(metadataForm) - .find(METADATA_FORM.valueField) - .type(value); -} -export function addPublicMetadataFieldFulfillmentOrder( - fulfillmentIndex, - name, - value, -) { - expandPublicFulfillmentMetadata(fulfillmentIndex); - cy.get('[data-test-id="fulfilled-order-section"]') - .eq(fulfillmentIndex) - .find('[data-test-is-private="false"]') - .find(METADATA_FORM.addFieldButton) - .click(); - typePublicFulfillmentMetadataName(name, 0); - typePublicFulfillmentMetadataValue(value, 0); -} -export function updatePublicMetadataFieldFulfillmentOrder( - fulfillmentIndex, - name, - value, -) { - expandPublicFulfillmentMetadata(fulfillmentIndex); - typePublicFulfillmentMetadataName(name, 0); - typePublicFulfillmentMetadataValue(value, 0); -} - -export function typePublicFulfillmentMetadataValue(name, valueIndex) { - return cy - .get(METADATA_FORM.publicMetaSection) - .find(METADATA_FORM.valueField) - .eq(valueIndex) - .clear() - .type(name); -} -export function typePrivateFulfillmentMetadataValue(name, valueIndex) { - return cy - .get(METADATA_FORM.privateMetaSection) - .find(METADATA_FORM.valueField) - .eq(valueIndex) - .clear() - .type(name); -} -export function typePublicFulfillmentMetadataName(name, nameIndex) { - return cy - .get(METADATA_FORM.publicMetaSection) - .find(METADATA_FORM.nameInput) - .eq(nameIndex) - .clear() - .type(name); -} -export function typePrivateFulfillmentMetadataName(name, nameIndex) { - return cy - .get(METADATA_FORM.privateMetaSection) - .find(METADATA_FORM.nameInput) - .eq(nameIndex) - .clear() - .type(name); -} -export function expandPublicFulfillmentMetadata(fulfillmentIndex) { - return cy - .get(METADATA_FORM.fulfillmentMetaSection) - .eq(fulfillmentIndex) - .find(METADATA_FORM.publicMetaSection) - .find(METADATA_FORM.metaExpandButton) - .click(); -} -export function deletePublicFulfillmentMetadata( - fulfillmentIndex, - metaDataIndex, -) { - return cy - .get(METADATA_FORM.fulfillmentMetaSection) - .eq(fulfillmentIndex) - .find(METADATA_FORM.publicMetaSection) - .find(METADATA_FORM.metaDeletedButton) - .eq(metaDataIndex) - .click(); -} -export function deletePrivateFulfillmentMetadata( - fulfillmentIndex, - metaDataIndex, -) { - return cy - .get(METADATA_FORM.fulfillmentMetaSection) - .eq(fulfillmentIndex) - .find(METADATA_FORM.privateMetaSection) - .find(METADATA_FORM.metaDeletedButton) - .eq(metaDataIndex) - .click(); -} -export function expandPrivateFulfillmentMetadata(fulfillmentIndex) { - return cy - .get(METADATA_FORM.fulfillmentMetaSection) - .eq(fulfillmentIndex) - .find(METADATA_FORM.privateMetaSection) - .find(METADATA_FORM.metaExpandButton) - .click(); -} -export function addPrivateMetadataFieldFulfillmentOrder( - fulfillmentIndex, - name, - value, -) { - expandPrivateFulfillmentMetadata(fulfillmentIndex); - cy.get(METADATA_FORM.fulfillmentMetaSection) - - .eq(fulfillmentIndex) - .find(METADATA_FORM.privateMetaSection) - .find(METADATA_FORM.addFieldButton) - .click(); - typePrivateFulfillmentMetadataName(name, 0); - typePrivateFulfillmentMetadataValue(value, 0); -} -export function updatePrivateMetadataFieldFulfillmentOrder( - fulfillmentIndex, - name, - value, -) { - expandPrivateFulfillmentMetadata(fulfillmentIndex); - typePrivateFulfillmentMetadataName(name, 0); - typePrivateFulfillmentMetadataValue(value, 0); -} diff --git a/cypress/support/pages/catalog/presetsAndSearch.js b/cypress/support/pages/catalog/presetsAndSearch.js deleted file mode 100644 index e50a1d88723..00000000000 --- a/cypress/support/pages/catalog/presetsAndSearch.js +++ /dev/null @@ -1,45 +0,0 @@ -import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; -import { PRESETS, SEARCH } from "../../../elements/shared"; - -export function searchItems(name) { - return cy - .addAliasToGraphRequest("ProductList") - .get(SEARCH.searchInput) - .type(name) - .wait("@ProductList"); -} -export function addPresetWithName(name) { - return cy - .get(PRESETS.addPresetButton) - .click() - .get(PRESETS.presetNameTextField) - .type(name) - .get(PRESETS.savePresetNameButton) - .click() - .wait("@ProductList"); -} -export function confirmGridRowsContainsText(name) { - return cy - .get(PRODUCTS_LIST.dataGridTable) - .find("tbody") - .find("tr") - .should("contain.text", name); -} -export function confirmActivePresetName(name) { - return cy.get(PRESETS.activePresetName).should("contain.text", name); -} -export function clickDeletePresetButton() { - return cy.get(PRESETS.presetDeleteButton).click(); -} -export function clickShowSavedPresetsButton() { - cy.get(PRESETS.activePresetName).click(); -} -export function clickSavedPresetContain(presetName) { - cy.get(PRESETS.savedPreset).contains(presetName).click(); -} -export function hoverSavedPresetContain(presetName) { - cy.get(PRESETS.savedPreset).contains(presetName).trigger("mouseover"); -} -export function clickUpdatePresetButton() { - cy.get(PRESETS.updatePresetButton).click(); -} diff --git a/cypress/support/pages/catalog/products/VariantsPage.js b/cypress/support/pages/catalog/products/VariantsPage.js deleted file mode 100644 index 653e457c5db..00000000000 --- a/cypress/support/pages/catalog/products/VariantsPage.js +++ /dev/null @@ -1,212 +0,0 @@ -import { PRICE_LIST } from "../../../../elements/catalog/products/price-list"; -import { PRODUCT_DETAILS } from "../../../../elements/catalog/products/product-details"; -import { VARIANTS_SELECTORS } from "../../../../elements/catalog/products/variants-selectors"; -import { AVAILABLE_CHANNELS_FORM } from "../../../../elements/channels/available-channels-form"; -import { BUTTON_SELECTORS } from "../../../../elements/shared/button-selectors"; -import { updateVariantWarehouse } from "../../../../support/api/requests/Product"; -import { formatDate } from "../../../formatData/formatDate"; -import { selectChannelVariantInDetailsPage } from "../../channelsPage"; - -export function variantsShouldBeVisible({ price }) { - cy.get(PRODUCT_DETAILS.variantRow).should("be.visible"); - cy.contains(PRODUCT_DETAILS.variantPrice, price); -} - -export function createVariant({ - sku, - warehouseName, - warehouseId, - attributeName, - price, - costPrice = price, - quantity = 10, - variantName, -}) { - fillUpVariantDetails({ - attributeName, - sku, - warehouseName, - warehouseId, - quantity, - costPrice, - price, - variantName, - }); - cy.get(VARIANTS_SELECTORS.saveButton) - .click() - .get(VARIANTS_SELECTORS.skuTextField) - .should("be.enabled") - .get(BUTTON_SELECTORS.back) - .click() - .get(PRODUCT_DETAILS.productNameInput) - .should("be.enabled"); -} - -export function fillUpGeneralVariantInputs({ - attributeName, - warehouseName, - sku, - quantity, -}) { - fillUpVariantAttributeAndSku({ attributeName, sku }); - cy.get(VARIANTS_SELECTORS.addWarehouseButton).click(); - if (warehouseName) { - cy.contains(VARIANTS_SELECTORS.warehouseOption, warehouseName).click({ - force: true, - }); - } else { - cy.get(VARIANTS_SELECTORS.warehouseOption).first().click({ force: true }); - } - cy.get(VARIANTS_SELECTORS.stockInput).type(quantity); -} - -export function fillUpVariantDetails({ - attributeName, - attributeType = "DROPDOWN", - sku, - warehouseName, - warehouseId, - quantity, - costPrice, - price, - variantName, -}) { - if (variantName) { - cy.get(VARIANTS_SELECTORS.variantNameInput).type(variantName, { - force: true, - }); - } - selectAttributeWithType({ attributeType, attributeName }); - - cy.get(PRICE_LIST.priceInput) - .each(input => { - cy.wrap(input).type(price, { force: true }); - }) - .get(PRICE_LIST.costPriceInput) - .each(input => { - cy.wrap(input).type(costPrice, { force: true }); - }); - if (sku) { - cy.get(VARIANTS_SELECTORS.skuTextField).click({ force: true }).type(sku); - } - if (warehouseName) { - cy.get(VARIANTS_SELECTORS.addWarehouseButton).click(); - cy.contains(VARIANTS_SELECTORS.warehouseOption, warehouseName) - .click({ - force: true, - }) - .get(VARIANTS_SELECTORS.stockInput) - .type(quantity); - } - if (warehouseId) { - saveVariant().then(({ response }) => { - const variantId = - response.body.data.productVariantCreate.productVariant.id; - updateVariantWarehouse({ variantId, warehouseId, quantity }); - }); - } - cy.get(VARIANTS_SELECTORS.saveButton).click(); -} - -export function fillUpVariantAttributeAndSku({ attributeName, sku }) { - cy.get(VARIANTS_SELECTORS.attributeSelector) - .click() - .get(VARIANTS_SELECTORS.attributeOption) - .contains(attributeName) - .click(); - if (sku) { - cy.get(VARIANTS_SELECTORS.skuTextField).click({ force: true }).type(sku); - } -} - -export function selectChannelForVariantAndFillUpPrices({ - channelName, - variantName, - price, - costPrice = price, -}) { - cy.waitForProgressBarToNotBeVisible().addAliasToGraphRequest( - "ProductChannelListingUpdate", - ); - selectChannelVariantInDetailsPage(channelName, variantName); - cy.get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductChannelListingUpdate"); - cy.contains(PRODUCT_DETAILS.variantRow, variantName) - .click() - .get(PRICE_LIST.priceInput) - .each(input => { - cy.wrap(input).type(price); - }) - .get(PRICE_LIST.costPriceInput) - .each(input => { - cy.wrap(input).type(costPrice); - }) - .addAliasToGraphRequest("ProductVariantChannelListingUpdate") - .get(VARIANTS_SELECTORS.saveButton) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductVariantChannelListingUpdate") - .get(PRICE_LIST.priceInput) - .should("be.enabled") - .get(BUTTON_SELECTORS.back) - .click() - .waitForProgressBarToNotBeVisible() - .get(AVAILABLE_CHANNELS_FORM.manageChannelsButton) - .should("be.visible"); -} - -export function selectOptionsAttribute(attributeName) { - cy.get(VARIANTS_SELECTORS.attributeSelector) - .click() - .get(VARIANTS_SELECTORS.attributeOption) - .contains(attributeName) - .click(); -} - -export function selectBooleanAttributeToTrue() { - cy.get(VARIANTS_SELECTORS.attributeSelector).first().click(); -} - -export function selectDateAttribute() { - cy.get(VARIANTS_SELECTORS.attributeSelector) - .first() - .find("input") - .type(formatDate(new Date())); -} - -export function selectNumericAttribute(numeric) { - cy.get(VARIANTS_SELECTORS.attributeSelector).first().type(numeric); -} - -export function selectAttributeWithType({ attributeType, attributeName }) { - switch (attributeType) { - case "DATE": - selectDateAttribute(); - break; - case "BOOLEAN": - selectBooleanAttributeToTrue(); - break; - case "NUMERIC": - selectNumericAttribute(attributeName); - break; - default: - selectOptionsAttribute(attributeName); - } -} - -export function saveVariant(waitForAlias = "VariantCreate") { - return cy - .addAliasToGraphRequest(waitForAlias) - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors(`@${waitForAlias}`); -} - -export function selectChannelsForVariant() { - cy.get(VARIANTS_SELECTORS.manageChannels) - .click() - .get(VARIANTS_SELECTORS.allChannels) - .check() - .get(BUTTON_SELECTORS.submit) - .click(); -} diff --git a/cypress/support/pages/catalog/products/priceListComponent.js b/cypress/support/pages/catalog/products/priceListComponent.js deleted file mode 100644 index 55fc8644141..00000000000 --- a/cypress/support/pages/catalog/products/priceListComponent.js +++ /dev/null @@ -1,15 +0,0 @@ -import { PRICE_LIST } from "../../../../elements/catalog/products/price-list"; - -export const priceInputLists = { - sellingPrice: PRICE_LIST.priceInput, - costPrice: PRICE_LIST.costPriceInput, -}; - -export function fillUpPriceList( - price = 1, - priceTypeInput = priceInputLists.sellingPrice, -) { - cy.get(priceTypeInput).each($priceInput => { - cy.wrap($priceInput).type(price, { force: true }); - }); -} diff --git a/cypress/support/pages/catalog/products/productDetailsPage.js b/cypress/support/pages/catalog/products/productDetailsPage.js deleted file mode 100644 index 2c74bd8d13e..00000000000 --- a/cypress/support/pages/catalog/products/productDetailsPage.js +++ /dev/null @@ -1,159 +0,0 @@ -import { PRODUCT_DETAILS } from "../../../../elements/catalog/products/product-details"; -import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list"; -import { AVAILABLE_CHANNELS_FORM } from "../../../../elements/channels/available-channels-form"; -import { BUTTON_SELECTORS } from "../../../../elements/shared/button-selectors"; -import { addMetadataField } from "../metadataComponent"; -import { editSeoSettings } from "../seoComponent"; - -const valueTrue = AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue; -const valueFalse = AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse; - -export function updateProductIsAvailableForPurchase(isAvailableForPurchase) { - const isAvailableForPurchaseSelector = isAvailableForPurchase - ? valueTrue - : valueFalse; - const availableForPurchaseSelector = `${AVAILABLE_CHANNELS_FORM.availableForPurchaseRadioButtons}${isAvailableForPurchaseSelector}`; - updateProductManageInChannel(availableForPurchaseSelector); -} - -export function updateProductPublish(isPublished) { - const isPublishedSelector = isPublished ? valueTrue : valueFalse; - const publishedSelector = `${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${isPublishedSelector}`; - updateProductManageInChannel(publishedSelector); -} - -export function updateProductVisibleInListings() { - updateProductManageInChannel(AVAILABLE_CHANNELS_FORM.visibleInListingsButton); -} - -function updateProductManageInChannel(manageSelector) { - cy.get(AVAILABLE_CHANNELS_FORM.assignedChannels) - .click() - .get(manageSelector) - .first() - .scrollIntoView() - .click() - // cypress click is to fast - our app is nor ready to handle new event when click occurs - solution could be disabling save button until app is ready to handle new event - .wait(1000) - .waitForProgressBarToNotBeVisible() - .addAliasToGraphRequest("ProductChannelListingUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear() - .wait("@ProductChannelListingUpdate"); -} - -export function fillUpCommonFieldsForAllProductTypes( - { generalInfo, seo, metadata, productOrganization }, - createMode = true, -) { - return fillUpAllCommonFieldsInCreateAndUpdate({ generalInfo, seo, metadata }) - .then(() => { - if (createMode) { - fillUpProductOrganization(productOrganization); - } else { - fillUpCollectionAndCategory({ - category: productOrganization.category, - collection: productOrganization.collection, - }); - } - }) - .then(productOrgResp => productOrgResp); -} - -export function fillUpAllCommonFieldsInCreateAndUpdate({ - generalInfo, - seo, - metadata, -}) { - return fillUpProductGeneralInfo(generalInfo) - .then(() => { - editSeoSettings(seo); - }) - .then(() => { - cy.get(BUTTON_SELECTORS.expandMetadataButton).first().click(); - addMetadataField(metadata.public); - }) - .then(() => { - cy.get(BUTTON_SELECTORS.expandMetadataButton).last().click(); - addMetadataField(metadata.private); - }); -} - -export function fillUpProductGeneralInfo({ name, description, rating }) { - return cy - .get(PRODUCT_DETAILS.productNameInput) - .click({ force: true }) - .clearAndType(name) - .get(PRODUCT_DETAILS.descriptionInput) - .clearAndType(description) - .get(PRODUCT_DETAILS.ratingInput) - .clearAndType(rating); -} - -export function fillUpProductTypeDialog({ productType }) { - const organization = {}; - return cy - .fillAutocompleteSelect(PRODUCTS_LIST.dialogProductTypeInput, productType) - .then(selected => { - organization.productType = selected; - return organization; - }); -} - -export function fillUpProductOrganization({ - productType, - category, - collection, -}) { - const organization = {}; - return cy - .fillAutocompleteSelect(PRODUCT_DETAILS.productTypeInput, productType, true) - .then(selected => { - organization.productType = selected; - fillUpCollectionAndCategory({ category, collection }); - }) - .then(collectionAndCategoryResp => { - organization.category = collectionAndCategoryResp.category; - organization.collection = collectionAndCategoryResp.collection; - return organization; - }); -} - -export function fillUpCollectionAndCategory({ category, collection }) { - const organization = {}; - return cy - .fillAutocompleteSelect(PRODUCT_DETAILS.categoryInput, category, false) - .then(selected => { - organization.category = selected; - cy.fillNewMultiSelect(PRODUCT_DETAILS.collectionInput, collection); - }) - .then(selected => { - organization.collection = selected; - return organization; - }); -} - -export function addVariantToDataGrid(variantName) { - cy.get(PRODUCT_DETAILS.addVariantButton) - .should("exist") - .click() - .get(PRODUCT_DETAILS.dataGridTable) - .should("be.visible") - .get(PRODUCT_DETAILS.firstRowDataGrid) - .click({ force: true }) - .type(variantName, { force: true }) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear() - .waitForProgressBarToNotBeVisible(); -} - -export function enterVariantEditPage() { - cy.get(PRODUCT_DETAILS.dataGridTable) - .scrollIntoView() - .should("be.visible") - .wait(1000) - .get(PRODUCT_DETAILS.editVariant) - .click(); -} diff --git a/cypress/support/pages/catalog/products/productsListPage.js b/cypress/support/pages/catalog/products/productsListPage.js deleted file mode 100644 index 49d5beaa1a1..00000000000 --- a/cypress/support/pages/catalog/products/productsListPage.js +++ /dev/null @@ -1,155 +0,0 @@ -import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list"; -import { BUTTON_SELECTORS } from "../../../../elements/shared/button-selectors"; -import { - getElementByDataTestId, - SHARED_ELEMENTS, -} from "../../../../elements/shared/sharedElements"; -import { urlList } from "../../../../fixtures/urlList"; -import { expectProductsSortedBy } from "../../../api/utils/products/productsListUtils"; - -export function isNumberOfProductsSameAsInSelectResultsOnPage() { - let numberOfResults; - - return cy - .get(PRODUCTS_LIST.productsList) - .should("be.visible") - .get(PRODUCTS_LIST.emptyProductRow) - .should("not.exist") - .then(() => { - cy.get(PRODUCTS_LIST.resultsOnPageSelect).invoke("text"); - }) - .then(text => { - numberOfResults = text; - getDisplayedColumnArray("name"); - }) - .then( - productsList => productsList.length === parseInt(numberOfResults, 10), - ); -} - -export function getDisplayedColumnArray(columnName) { - let productsList = new Array(); - - return cy - .get(PRODUCTS_LIST.productsList) - .each($product => { - cy.wrap($product) - .find(PRODUCTS_LIST.productRowElements[columnName]) - .invoke("text") - .then(productName => { - productsList = productsList.concat([productName]); - }); - }) - .then(() => productsList); -} - -export function selectFilterOption(filter, optionName) { - selectFilterBy(filter) - .get(PRODUCTS_LIST.filters.filterField[filter]) - .find(PRODUCTS_LIST.filters.filterBySearchInput) - .type(optionName); - cy.get(PRODUCTS_LIST.filters.filterField[filter]) - .contains(PRODUCTS_LIST.filters.filterOption, optionName) - .find(BUTTON_SELECTORS.checkbox) - .click(); - submitFilters(); -} -export function filterProductsWithNewFilters(filter, optionName) { - cy.get(PRODUCTS_LIST.newFilters.showFiltersButton).click(); - cy.get(PRODUCTS_LIST.newFilters.addFilterButton).click(); - cy.get(PRODUCTS_LIST.newFilters.leftInput).click(); - cy.get(PRODUCTS_LIST.newFilters.dropDownOptions).contains(filter).click(); - cy.get(PRODUCTS_LIST.newFilters.rightInput) - .click() - .invoke("attr", "aria-expanded") - .should("eq", "true"); - cy.get(PRODUCTS_LIST.newFilters.rightInput).type(optionName); - cy.get(PRODUCTS_LIST.newFilters.dropDownOptions).contains(optionName).click(); - cy.get(PRODUCTS_LIST.newFilters.saveFiltersButton).click(); -} - -export function selectAttributeFilter(attributeSlug, attributeValue) { - selectFilterByAttribute(attributeSlug); - cy.get( - `${getElementByDataTestId(attributeSlug)}${ - PRODUCTS_LIST.filters.filterField.filterField - }`, - ) - .find(PRODUCTS_LIST.filters.filterOption) - .should("be.visible") - .contains(attributeValue) - .should("be.visible") - .find(BUTTON_SELECTORS.checkbox) - .click(); - submitFilters(); -} - -export function selectProductsOutOfStock() { - cy.get(PRODUCTS_LIST.filters.filterBy.stock) - .click() - .get(PRODUCTS_LIST.filters.productsOutOfStockOption) - .click(); - submitFilters(); -} - -export function selectFilterBy(filter) { - return showFilters() - .get(PRODUCTS_LIST.filters.filterBy[filter]) - .click({ force: true }); -} - -export function selectFilterByAttribute(attributeSlug) { - return showFilters() - .get( - `${getElementByDataTestId(attributeSlug)}${ - SHARED_ELEMENTS.filters.filterGroupActivateCheckbox - }`, - ) - .click(); -} - -export function showFilters() { - return cy.get(PRODUCTS_LIST.showFiltersButton).click(); -} - -export function selectChannel(channelSlug) { - cy.waitForProgressBarToNotExist(); - selectFilterBy("channel"); - // react is not as fast as cypress makes it flaky and can not follow with actions on filters - cy.wait(1000); - cy.get(getElementByDataTestId(channelSlug)).click(); -} - -export function submitFilters() { - cy.get(BUTTON_SELECTORS.submit) - .scrollIntoView() - .should("be.visible") - .click() - .waitForRequestAndCheckIfNoErrors("@ProductList") - .get(PRODUCTS_LIST.emptyProductRow) - .should("not.exist"); -} - -export function enterProductListPage() { - cy.visit(urlList.products) - .expectSkeletonIsVisible() - .waitForProgressBarToNotExist(); -} - -export function sortProductsBy(sortBy) { - expectProductsSortedBy(sortBy); - cy.addAliasToGraphRequest("ProductList") - .get(PRODUCTS_LIST.tableHeaders[sortBy]) - .click() - .waitForProgressBarToNotExist() - .waitForRequestAndCheckIfNoErrors("@ProductList"); - expectProductsSortedBy(sortBy, false); -} - -export function changeToTileView() { - cy.clickOnElement(PRODUCTS_LIST.tileViewButton); -} - -export function changeToDatagridView() { - cy.clickOnElement(PRODUCTS_LIST.datagridViewButton); -} diff --git a/cypress/support/pages/catalog/seoComponent.js b/cypress/support/pages/catalog/seoComponent.js deleted file mode 100644 index 672cce8ded5..00000000000 --- a/cypress/support/pages/catalog/seoComponent.js +++ /dev/null @@ -1,12 +0,0 @@ -import { SEO_FORM } from "../../../elements/shared/seo/seo-form-selectors"; - -export function editSeoSettings({ slug, title, description }) { - cy.get(SEO_FORM.editSeoSettings) - .click() - .get(SEO_FORM.slugInput) - .clearAndType(slug) - .get(SEO_FORM.titleInput) - .clearAndType(title) - .get(SEO_FORM.descriptionInput) - .clearAndType(description, { delay: 0 }); -} diff --git a/cypress/support/pages/channelsPage.js b/cypress/support/pages/channelsPage.js deleted file mode 100644 index 61ad8996d09..00000000000 --- a/cypress/support/pages/channelsPage.js +++ /dev/null @@ -1,168 +0,0 @@ -import { ADD_CHANNEL_FORM_SELECTORS } from "../../elements/channels/add-channel-form-selectors"; -import { AVAILABLE_CHANNELS_FORM } from "../../elements/channels/available-channels-form"; -import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors"; -import { CHANNELS_SELECTORS } from "../../elements/channels/channels-selectors"; -import { SELECT_CHANNELS_TO_ASSIGN } from "../../elements/channels/select-channels-to-assign"; -import { HEADER_SELECTORS } from "../../elements/header/header-selectors"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { urlList } from "../../fixtures/urlList"; - -export function createChannelByView({ - name, - currency, - slug = name, - shippingZone, - defaultCountry = "Poland", - warehouse, -}) { - setChannelRequiredFields({ - name, - currency, - slug, - shippingZone, - defaultCountry, - warehouse, - }); - cy.get(ADD_CHANNEL_FORM_SELECTORS.saveButton).click(); -} -export function setChannelRequiredFields({ - name, - currency, - slug = name, - shippingZone, - defaultCountry = "Poland", - warehouse, -}) { - cy.addAliasToGraphRequest("Channel"); - clickCreateChannelButton(); - cy.get(ADD_CHANNEL_FORM_SELECTORS.channelName) - .click({ force: true }) - .type(name, { force: true }) - .get(ADD_CHANNEL_FORM_SELECTORS.slug) - .click({ force: true }) - .type(slug, { force: true }) - .get(ADD_CHANNEL_FORM_SELECTORS.currency) - .find("input") - .should("be.enabled") - .click(); - cy.get(ADD_CHANNEL_FORM_SELECTORS.currency).type(currency); - cy.get("body").then($body => { - if ($body.find(currency).length) { - cy.contains(ADD_CHANNEL_FORM_SELECTORS.currencyOptions, currency).click(); - } else { - cy.get(ADD_CHANNEL_FORM_SELECTORS.currencyAutocompleteDropdown).click(); - } - }); - cy.fillAutocompleteSelect( - ADD_CHANNEL_FORM_SELECTORS.countryAutocompleteInput, - defaultCountry, - ); - if (shippingZone) { - addShippingZone(shippingZone); - } - if (warehouse) { - addWarehouse(warehouse); - } -} - -export function addShippingZone(shippingZone) { - cy.get(BUTTON_SELECTORS.expandIcon) - .first() - .click() - .get(ADD_CHANNEL_FORM_SELECTORS.addShippingZoneButton) - .click() - .fillAutocompleteSelect( - ADD_CHANNEL_FORM_SELECTORS.shippingAutocompleteSelect, - shippingZone, - ); -} -export function typeExpirationDays(expirationDays) { - cy.get(CHANNELS_SELECTORS.orderExpirationInput) - .click({ force: true }) - .clear() - .type(expirationDays); -} - -export function clickCreateChannelButton() { - return cy.get(CHANNELS_SELECTORS.createChannelButton).click(); -} - -export function addWarehouse(warehouse) { - cy.get(BUTTON_SELECTORS.expandIcon) - .last() - .click() - .get(ADD_CHANNEL_FORM_SELECTORS.addWarehouseButton) - .click() - .fillAutocompleteSelect( - ADD_CHANNEL_FORM_SELECTORS.warehouseAutocompleteSelect, - warehouse, - ); -} - -export function selectChannelInPicker(channelName) { - cy.get(CHANNEL_FORM_SELECTORS.channelSelect).click(); - cy.contains(CHANNEL_FORM_SELECTORS.channelOption, channelName) - .click() - .get(CHANNEL_FORM_SELECTORS.confirmButton) - .click(); -} - -export function selectChannelInHeader(channelName) { - cy.get(HEADER_SELECTORS.channelSelect).click(); - cy.contains(SHARED_ELEMENTS.selectOption, channelName) - .click({ force: true }) - .get(SHARED_ELEMENTS.selectOption) - .should("not.exist"); -} - -export function selectChannelInDetailsPages(channelName) { - cy.get(AVAILABLE_CHANNELS_FORM.manageChannelsButton) - .click() - .get(SELECT_CHANNELS_TO_ASSIGN.allChannelsCheckbox) - .click(); - if (channelName) { - cy.get(SELECT_CHANNELS_TO_ASSIGN.listOfChannels) - .contains(channelName) - .click(); - } else { - cy.get(SELECT_CHANNELS_TO_ASSIGN.channelRow) - .first() - .find(SELECT_CHANNELS_TO_ASSIGN.channelCheckbox) - .click(); - } - cy.get(SELECT_CHANNELS_TO_ASSIGN.selectChannelsForm) - .find(BUTTON_SELECTORS.submit) - .click({ force: true }); -} - -export function selectChannelVariantInDetailsPage(channelName, attributeName) { - cy.get(AVAILABLE_CHANNELS_FORM.manageChannelsButton).click(); - const channelsNames = Array.isArray(channelName) - ? channelName - : [channelName]; - channelsNames.forEach(name => { - cy.contains(SELECT_CHANNELS_TO_ASSIGN.expandChannelRow, name) - .find(BUTTON_SELECTORS.expandIcon) - .click(); - cy.contains(SELECT_CHANNELS_TO_ASSIGN.expandChannelRow, name) - .contains(SELECT_CHANNELS_TO_ASSIGN.channelVariantRow, attributeName) - .find(BUTTON_SELECTORS.checkbox) - .click(); - }); - cy.get(SELECT_CHANNELS_TO_ASSIGN.selectChannelsForm) - .find(BUTTON_SELECTORS.submit) - .click({ force: true }); -} - -export function enterHomePageAndChangeChannel(channelName) { - cy.visit(urlList.homePage); - selectChannelInHeader(channelName); -} - -export function enterHomePageChangeChannelAndReturn(channelName) { - cy.url().then(url => { - enterHomePageAndChangeChannel(channelName); - cy.visit(url); - }); -} diff --git a/cypress/support/pages/columnPicker.js b/cypress/support/pages/columnPicker.js deleted file mode 100644 index 8f6d16a8395..00000000000 --- a/cypress/support/pages/columnPicker.js +++ /dev/null @@ -1,22 +0,0 @@ -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; - -export function openColumnPicker() { - cy.get(SHARED_ELEMENTS.openColumnPickerButton).click(); -} -export function openDynamicColumnsSearch() { - cy.get(SHARED_ELEMENTS.openDynamicColumnsSearchButton).click(); -} -export function selectDynamicColumnAtIndex(columnIndex) { - return cy - .get(SHARED_ELEMENTS.dynamicColumnNameSelector) - .eq(columnIndex) - .click(); -} -export function typeNameInSearchColumnInput(columnName) { - return cy - .get(SHARED_ELEMENTS.dynamicColumnSearchInput) - .should("be.visible") - .click() - .type(columnName) - .blur(); -} diff --git a/cypress/support/pages/configurationPage.js b/cypress/support/pages/configurationPage.js deleted file mode 100644 index 08568287e6c..00000000000 --- a/cypress/support/pages/configurationPage.js +++ /dev/null @@ -1,12 +0,0 @@ -import { CONFIGURATION_SELECTORS } from "../../elements"; - -export function expectConfigurationAvailableSectionsNumber(sectionsNumber) { - cy.get(CONFIGURATION_SELECTORS.configurationMenu) - .find("[data-test-id*=subsection]") - .should("have.length", sectionsNumber); -} -export function expectConfigurationSectionsToBeVisible(...sections) { - sections.forEach(selector => { - cy.get(selector).scrollIntoView().should("be.visible"); - }); -} diff --git a/cypress/support/pages/discounts/salesPage.js b/cypress/support/pages/discounts/salesPage.js deleted file mode 100644 index 632ac24113e..00000000000 --- a/cypress/support/pages/discounts/salesPage.js +++ /dev/null @@ -1,155 +0,0 @@ -import { SALES_SELECTORS } from "../../../elements/discounts/sales"; -import { ASSIGN_ELEMENTS_SELECTORS } from "../../../elements/shared/assign-elements-selectors"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { urlList } from "../../../fixtures/urlList"; -import { getVariantWithSaleStatus } from "../../../support/api/utils/discounts/salesUtils"; -import { formatDate } from "../../../support/formatData/formatDate"; -import { getVariant } from "../../api/requests/Product"; -import { createProductInChannel } from "../../api/utils/products/productsUtils"; -import { getProductPrice } from "../../api/utils/storeFront/storeFrontProductUtils"; -import { selectChannelInDetailsPages } from "../channelsPage"; - -export const discountOptions = { - PERCENTAGE: SALES_SELECTORS.percentageOption, - FIXED: SALES_SELECTORS.fixedOption, -}; - -export function createSale({ - saleName, - channelName, - discountValue = 10, - discountOption = discountOptions.PERCENTAGE, -}) { - const todaysDate = formatDate(new Date()); - - cy.get(SALES_SELECTORS.createSaleButton) - .click() - .get(SALES_SELECTORS.nameInput) - .type(saleName) - .get(discountOption) - .click(); - selectChannelInDetailsPages(channelName); - cy.get(SALES_SELECTORS.discountValue) - .type(discountValue) - .get(SALES_SELECTORS.startDateInput) - .type(todaysDate) - .addAliasToGraphRequest("SaleCreate") - .get(SALES_SELECTORS.saveButton) - .click() - .waitForRequestAndCheckIfNoErrors("@SaleCreate"); -} - -export function assignProducts(productName) { - cy.waitForProgressBarToNotBeVisible() - .get(SALES_SELECTORS.productsTab) - .click() - .get(SALES_SELECTORS.assignProducts) - .click() - .get(ASSIGN_ELEMENTS_SELECTORS.searchInput) - .type(productName); - cy.contains(ASSIGN_ELEMENTS_SELECTORS.productTableRow, productName) - .find(ASSIGN_ELEMENTS_SELECTORS.checkbox) - .click(); - cy.addAliasToGraphRequest("SaleCataloguesAdd"); - cy.get(BUTTON_SELECTORS.submit).click(); - cy.waitForRequestAndCheckIfNoErrors("@SaleCataloguesAdd"); -} - -export function assignVariants(productName, variantName) { - cy.waitForProgressBarToNotBeVisible() - .get(SALES_SELECTORS.variantsTab) - .click() - .get(SALES_SELECTORS.assignVariants) - .click() - .get(ASSIGN_ELEMENTS_SELECTORS.searchInput) - .type(productName) - .get(ASSIGN_ELEMENTS_SELECTORS.variantTableRow) - .should("have.length", 1); - cy.contains(ASSIGN_ELEMENTS_SELECTORS.variantTableRow, variantName) - .find(ASSIGN_ELEMENTS_SELECTORS.checkbox) - .click(); - cy.addAliasToGraphRequest("SaleCataloguesAdd"); - cy.get(BUTTON_SELECTORS.submit).click(); - cy.waitForRequestAndCheckIfNoErrors("@SaleCataloguesAdd"); -} - -export function createSaleWithNewProduct({ - name, - channel, - warehouseId, - productTypeId, - attributeId, - categoryId, - price, - discountOption, - discountValue, - taxClassId, -}) { - return createProductInChannel({ - name, - channelId: channel.id, - warehouseId, - productTypeId, - attributeId, - categoryId, - price, - taxClassId, - }).then(({ product: productResp }) => { - const product = productResp; - /* Uncomment after fixing SALEOR-3367 bug - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) - */ - cy.visit(urlList.sales); - createSale({ - saleName: name, - channelName: channel.name, - discountValue, - discountOption, - }); - assignProducts(product.name); - return getProductPrice(product.id, channel.slug); - }); -} - -export function createSaleWithNewVariant({ - name, - channel, - warehouseId, - productTypeId, - attributeId, - categoryId, - price, - discountValue, - discountOption, -}) { - return createProductInChannel({ - name, - channelId: channel.id, - warehouseId, - productTypeId, - attributeId, - categoryId, - price, - }).then(({ variantsList: variantsListResp, product }) => { - const variant = variantsListResp[0]; - /* Uncomment after fixing SALEOR-3367 bug - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) - */ - cy.visit(urlList.sales); - createSale({ - saleName: name, - channelName: channel.name, - discountValue, - discountOption, - }); - assignVariants(product.name, variant.name); - getVariantWithSaleStatus({ - channelSlug: channel.slug, - variantId: variant.id, - onSaleStatus: true, - }); - return getVariant(variant.id, channel.slug, "token"); - }); -} diff --git a/cypress/support/pages/discounts/vouchersPage.js b/cypress/support/pages/discounts/vouchersPage.js deleted file mode 100644 index 80f3d6db6c0..00000000000 --- a/cypress/support/pages/discounts/vouchersPage.js +++ /dev/null @@ -1,119 +0,0 @@ -import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers"; -import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { urlList, voucherDetailsUrl } from "../../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; -import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas"; -import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils"; -import { selectChannelInDetailsPages } from "../channelsPage"; - -export const discountOptions = { - PERCENTAGE: VOUCHERS_SELECTORS.percentageDiscountRadioButton, - FIXED: VOUCHERS_SELECTORS.fixedDiscountRadioButton, - SHIPPING: VOUCHERS_SELECTORS.shippingDiscountRadioButton, -}; - -export function createVoucher({ - voucherCode, - voucherValue, - discountOption, - channelName, - usageLimit, - applyOnePerCustomer, - onlyStaff, - minOrderValue, - minAmountOfItems, -}) { - cy.get(VOUCHERS_SELECTORS.createVoucherButton).click(); - selectChannelInDetailsPages(channelName); - cy.get(VOUCHERS_SELECTORS.voucherCodeAddButton).click(); - cy.get(VOUCHERS_SELECTORS.manualVoucherItem).click(); - cy.get(VOUCHERS_SELECTORS.voucherCodeNameInput).type(voucherCode); - cy.get(VOUCHERS_SELECTORS.voucherCodeConfirmButton).click(); - cy.get(discountOption).click(); - if (discountOption !== discountOptions.SHIPPING) { - cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue, { - force: true, - }); - } - if (usageLimit) { - cy.get(VOUCHERS_SELECTORS.limits.usageLimitCheckbox) - .click() - .type(usageLimit); - } - if (applyOnePerCustomer) { - cy.get(VOUCHERS_SELECTORS.limits.applyOncePerCustomerCheckbox).click(); - } - if (onlyStaff) { - cy.get(VOUCHERS_SELECTORS.limits.onlyForStaffCheckbox).click(); - } - if (minOrderValue) { - cy.get(VOUCHERS_SELECTORS.requirements.minOrderValueCheckbox) - .click() - .get(VOUCHERS_SELECTORS.requirements.minOrderValueInput) - .type(minOrderValue, { force: true }); - } - if (minAmountOfItems) { - cy.get(VOUCHERS_SELECTORS.requirements.minAmountOfItemsCheckbox) - .click() - .get(VOUCHERS_SELECTORS.requirements.minCheckoutItemsQuantityInput) - .type(minAmountOfItems); - } - cy.get(BUTTON_SELECTORS.confirm).click().confirmationMessageShouldAppear(); -} - -export function setVoucherDate({ - voucherId, - startDate, - endDate, - endTime, - hasEndDate = false, -}) { - cy.visit(voucherDetailsUrl(voucherId)).waitForProgressBarToNotBeVisible(); - if (startDate) { - cy.get(VOUCHERS_SELECTORS.startDateInput).type(startDate); - } - if (endDate) { - if (hasEndDate) { - cy.get(VOUCHERS_SELECTORS.hasEndDateCheckbox).click({ force: true }); - } - cy.get(VOUCHERS_SELECTORS.endDateInput) - .type(endDate) - .get(VOUCHERS_SELECTORS.endTimeInput) - .type(endTime); - } - cy.addAliasToGraphRequest("VoucherUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@VoucherUpdate"); -} - -export function loginAndCreateCheckoutForVoucherWithDiscount({ - discount, - voucherValue, - voucherCode, - channelName, - dataForCheckout, - usageLimit, - applyOnePerCustomer, - onlyStaff, - minOrderValue, - minAmountOfItems, -}) { - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) - .visit(urlList.vouchers); - ensureCanvasStatic(); - createVoucher({ - voucherCode, - voucherValue, - discountOption: discount, - channelName, - usageLimit, - applyOnePerCustomer, - onlyStaff, - minOrderValue, - minAmountOfItems, - }); - dataForCheckout.voucherCode = voucherCode; - return createCheckoutWithVoucher(dataForCheckout); -} diff --git a/cypress/support/pages/draftOrderPage.js b/cypress/support/pages/draftOrderPage.js deleted file mode 100644 index 8dd4382e31e..00000000000 --- a/cypress/support/pages/draftOrderPage.js +++ /dev/null @@ -1,43 +0,0 @@ -import { DRAFT_ORDER_SELECTORS } from "../../elements/orders/draft-order-selectors"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { SELECT_SHIPPING_METHOD_FORM } from "../../elements/shipping/select-shipping-method-form"; - -export function finalizeDraftOrder(name) { - cy.addAliasToGraphRequest("OrderDraftFinalize"); - cy.get(DRAFT_ORDER_SELECTORS.addProducts) - .click() - .assignElements(name) - .get(DRAFT_ORDER_SELECTORS.editCustomerButton) - .click() - .get(DRAFT_ORDER_SELECTORS.selectCustomer) - .type(name); - return cy - .contains(DRAFT_ORDER_SELECTORS.selectCustomerOption, name, { - matchCase: false, - }) - .click() - .get(DRAFT_ORDER_SELECTORS.newAddressSelectButton) - .should("be.visible") - .get(BUTTON_SELECTORS.submit) - .click() - .get(DRAFT_ORDER_SELECTORS.customerEmail) - .should("be.visible") - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink) - .click() - .get(SELECT_SHIPPING_METHOD_FORM.selectShippingMethod) - .click() - .get(SELECT_SHIPPING_METHOD_FORM.shippingMethodOption) - .first() - .click() - .addAliasToGraphRequest("OrderShippingMethodUpdate") - .get(SELECT_SHIPPING_METHOD_FORM.submitButton) - .click() - .wait("@OrderShippingMethodUpdate") - .get(DRAFT_ORDER_SELECTORS.finalizeButton) - .click() - .waitForRequestAndCheckIfNoErrors("@OrderDraftFinalize") - .confirmationMessageShouldAppear(); -} diff --git a/cypress/support/pages/homePage.js b/cypress/support/pages/homePage.js deleted file mode 100644 index f501eafa5e6..00000000000 --- a/cypress/support/pages/homePage.js +++ /dev/null @@ -1,76 +0,0 @@ -import { HEADER_SELECTORS } from "../../elements/header/header-selectors"; -import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors"; - -export function changeChannel(channelName) { - cy.get(HEADER_SELECTORS.channelSelect) - .click() - .get(HEADER_SELECTORS.channelSelectList) - .contains(channelName) - .click(); -} - -export function expectWelcomeMessageIncludes(name) { - cy.get(HOMEPAGE_SELECTORS.welcomeMessage) - .invoke("text") - .then(text => { - expect(text, `welcome message should contains ${name}`).to.contains(name); - }); -} - -export function getOrdersReadyToFulfillRegex( - ordersReadyToFulfillBefore, - quantityOfNewOrders, -) { - const allOrdersReadyToFulfill = - ordersReadyToFulfillBefore + quantityOfNewOrders; - const notANumberRegex = "\\D*"; - return new RegExp( - `${notANumberRegex}${allOrdersReadyToFulfill}${notANumberRegex}`, - ); -} - -export function getOrdersReadyForCaptureRegex( - ordersReadyForCaptureBefore, - quantityOfNewOrders, -) { - const allOrdersReadyForCapture = - ordersReadyForCaptureBefore + quantityOfNewOrders; - const notANumberRegex = "\\D*"; - return new RegExp( - `${notANumberRegex}${allOrdersReadyForCapture}${notANumberRegex}`, - ); -} - -export function getProductsOutOfStockRegex( - productsOutOfStockBefore, - quantityOfNewProducts, -) { - const allProductsOutOfStock = - productsOutOfStockBefore + quantityOfNewProducts; - const notANumberRegex = "\\D*"; - return new RegExp( - `${notANumberRegex}${allProductsOutOfStock}${notANumberRegex}`, - ); -} - -export function getSalesAmountRegex(salesAmountBefore, addedAmount) { - const totalAmount = salesAmountBefore + addedAmount; - const totalAmountString = totalAmount.toFixed(2); - const totalAmountIntegerValue = totalAmountString.split(".")[0]; - const totalAmountDecimalValue = totalAmountString.split(".")[1]; - const decimalSeparator = "[,.]"; - const totalAmountIntegerWithThousandsSeparator = new Intl.NumberFormat("en") - .format(totalAmountIntegerValue) - .replaceAll(",", "[,.]*"); - const totalAmountWithSeparators = `${totalAmountIntegerWithThousandsSeparator}${decimalSeparator}${totalAmountDecimalValue}`; - const notANumberRegex = "\\D*"; - return new RegExp( - `${notANumberRegex}${totalAmountWithSeparators}${notANumberRegex}`, - ); -} - -export function getTodaysOrdersRegex(ordersBefore, quantityOfNewOrders) { - const allOrders = ordersBefore + quantityOfNewOrders; - const notANumberRegex = "\\D*"; - return new RegExp(`${notANumberRegex}${allOrders}${notANumberRegex}`); -} diff --git a/cypress/support/pages/index.js b/cypress/support/pages/index.js deleted file mode 100644 index 04fe489529a..00000000000 --- a/cypress/support/pages/index.js +++ /dev/null @@ -1,43 +0,0 @@ -export * as ordersOperationsHelpers from "./ordersOperations"; -export * as transactionsOrderUtils from "./ordersTransactionUtils"; -export { - addMetadataField, - addPrivateMetadataFieldFulfillmentOrder, - addPublicMetadataFieldFulfillmentOrder, - deletePrivateFulfillmentMetadata, - deletePublicFulfillmentMetadata, - expandPrivateFulfillmentMetadata, - expandPublicFulfillmentMetadata, - updatePrivateMetadataFieldFulfillmentOrder, - updatePublicMetadataFieldFulfillmentOrder, -} from "./catalog/metadataComponent"; -export { selectChannelInPicker } from "./channelsPage"; -export { finalizeDraftOrder } from "./draftOrderPage"; -export { - addNewProductToOrder, - applyFixedLineDiscountForProduct, - changeQuantityOfProducts, - deleteProductFromGridTableOnIndex, - openVariantDetailsOptions, -} from "./ordersOperations"; -export { expectWelcomeMessageIncludes } from "./homePage"; -export { getDisplayedSelectors } from "./permissionsPage"; -export { - fillUpOnlyUserDetails, - fillUpSetPassword, - fillUpUserDetailsAndAddFirstPermission, - updateUserActiveFlag, -} from "./userPage"; -export { - expectMainMenuAvailableSections, - expectMainMenuSectionsToBeVisible, -} from "./mainMenuPage"; -export * as productListPage from "./catalog/products/productsListPage"; -export * as productDetailsPage from "./catalog/products/productDetailsPage"; -export * as priceListComponent from "./catalog/products/priceListComponent"; -export * as variantsPage from "./catalog/products/VariantsPage"; -export * as channelsPage from "./channelsPage"; -export * as pagesPage from "./pagesPage"; -export * as columnPickerPage from "./columnPicker"; -export * as pageDetailsPage from "./pageDetailsPage"; -export * as giftCardsPage from "./catalog/giftCardPage"; diff --git a/cypress/support/pages/mainMenuPage.js b/cypress/support/pages/mainMenuPage.js deleted file mode 100644 index 601406c430e..00000000000 --- a/cypress/support/pages/mainMenuPage.js +++ /dev/null @@ -1,12 +0,0 @@ -import { MENU_SELECTORS } from "../../elements"; - -export function expectMainMenuAvailableSections(sectionsNumber) { - cy.get(MENU_SELECTORS.MENU.list) - .find(MENU_SELECTORS.MENU.menuItem) - .should("have.length", sectionsNumber); -} -export function expectMainMenuSectionsToBeVisible(...sections) { - sections.forEach(selector => { - cy.get(selector).should("be.visible"); - }); -} diff --git a/cypress/support/pages/navigationPage.js b/cypress/support/pages/navigationPage.js deleted file mode 100644 index 3aab49a760a..00000000000 --- a/cypress/support/pages/navigationPage.js +++ /dev/null @@ -1,59 +0,0 @@ -import { MENU_DETAILS } from "../../elements/navigation/menu-details"; -import { MENU_LIST } from "../../elements/navigation/menu-list"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { menuDetailsUrl, urlList } from "../../fixtures/urlList"; - -export function createMenu(name) { - return cy - .visit(urlList.navigation) - .get(MENU_LIST.addMenuButton) - .click() - .get(MENU_LIST.createMenuForm.nameInput) - .type(name) - .addAliasToGraphRequest("MenuCreate") - .get(BUTTON_SELECTORS.submit) - .click() - .confirmationMessageShouldDisappear() - .wait("@MenuCreate") - .its("response.body.data.menuCreate.menu"); -} - -export function createNewMenuItem({ menuId, name, menuItemType }) { - let selectedItem; - - return cy - .visit(menuDetailsUrl(menuId)) - .wait("@SearchCollections") - .wait("@SearchPages") - .wait("@SearchCategories") - .get(MENU_DETAILS.createNewMenuItemButton) - .click() - .get(SHARED_ELEMENTS.dialog) - .find(MENU_DETAILS.newMenuItemForm.nameInput) - .type(name) - .get(MENU_DETAILS.newMenuItemForm.autocompleteSelectReference) - .click() - .get(SHARED_ELEMENTS.progressBar) - .should("be.not.visible") - .get(MENU_DETAILS.newMenuItemForm[menuItemType]) - .click() - .get(MENU_DETAILS.newMenuItemForm.anyMenuItem) - .click() - .invoke("text") - .then(text => { - selectedItem = text; - cy.addAliasToGraphRequest("MenuItemCreate") - .get(BUTTON_SELECTORS.submit) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@MenuItemCreate"); - }) - .then(() => selectedItem); -} - -export const MENU_ITEM_TYPES = { - category: "categoryItem", - collection: "collectionItem", - page: "pageItem", -}; diff --git a/cypress/support/pages/ordersOperations.js b/cypress/support/pages/ordersOperations.js deleted file mode 100644 index fbdcb84d671..00000000000 --- a/cypress/support/pages/ordersOperations.js +++ /dev/null @@ -1,86 +0,0 @@ -import { - ADD_PRODUCT_TO_ORDER_DIALOG, - BUTTON_SELECTORS, - CHANNEL_FORM_SELECTORS, - DRAFT_ORDER_SELECTORS, - ORDERS_SELECTORS, - SHARED_ELEMENTS, -} from "../../elements"; - -export function pickAndSelectChannelOnCreateOrderFormByIndex(index) { - cy.get(ORDERS_SELECTORS.createOrderButton) - .click() - .get(CHANNEL_FORM_SELECTORS.channelSelect) - .click() - .get(CHANNEL_FORM_SELECTORS.channelOption) - .eq(index) - .click(); -} -export function applyFixedLineDiscountForProduct( - discountAmount, - discountReason, -) { - cy.get(ORDERS_SELECTORS.dataGridTable).should("be.visible"); - cy.get(ORDERS_SELECTORS.priceCellFirstRowOrderDetails) - .dblclick({ force: true }) - .type("2", { force: true }); - cy.get(ORDERS_SELECTORS.discountFixedPriceButton).click(); - cy.get(ORDERS_SELECTORS.discountAmountField).type(discountAmount); - cy.get(ORDERS_SELECTORS.discountReasonField).type(discountReason); - cy.addAliasToGraphRequest("OrderLineDiscountUpdate") - .clickSubmitButton() - .click() - .waitForRequestAndCheckIfNoErrors("@OrderLineDiscountUpdate"); -} -export function changeQuantityOfProducts() { - cy.addAliasToGraphRequest("OrderLineUpdate"); - cy.get(ORDERS_SELECTORS.dataGridTable).should("be.visible"); - cy.get(ORDERS_SELECTORS.quantityCellFirstRowOrderDetails) - .click({ force: true }) - .should("have.attr", "aria-selected", "true") - .click({ force: true }) - .wait(1000); - cy.get(ORDERS_SELECTORS.gridClip) - .find("input") - .clear({ force: true }) - .type("2"); - - // grid expects focus to be dismissed from cell - because of that extra action needed which blur focus from cell (other more elegant build in actions was not working) - cy.get(SHARED_ELEMENTS.pageHeader) - .click() - .waitForRequestAndCheckIfNoErrors("@OrderLineUpdate"); -} -export function deleteProductFromGridTableOnIndex(trIndex = 0) { - cy.get(ORDERS_SELECTORS.dataGridTable).should("be.visible"); - cy.addAliasToGraphRequest("OrderLineDelete") - .get(BUTTON_SELECTORS.showMoreButton) - .eq(trIndex) - .click() - .get(ORDERS_SELECTORS.productDeleteFromRowButton) - .click() - .wait("@OrderLineDelete"); -} - -export function openVariantDetailsOptions(variantIndex = 1) { - return cy.get(BUTTON_SELECTORS.showMoreButton).eq(variantIndex).click(); -} - -export function addNewProductToOrder(productIndex = 0, variantIndex = 0) { - cy.get(DRAFT_ORDER_SELECTORS.addProducts).click(); - return cy - .get(ADD_PRODUCT_TO_ORDER_DIALOG.productRow) - .eq(productIndex) - .find(ADD_PRODUCT_TO_ORDER_DIALOG.productName) - .invoke("text") - .then(productName => { - cy.get(ADD_PRODUCT_TO_ORDER_DIALOG.productVariant) - .eq(variantIndex) - .find(ADD_PRODUCT_TO_ORDER_DIALOG.checkbox) - .click(); - cy.addAliasToGraphRequest("OrderLinesAdd") - .get('[type="submit"]') - .click() - .waitForRequestAndCheckIfNoErrors("@OrderLinesAdd"); - cy.wrap(productName); - }); -} diff --git a/cypress/support/pages/ordersTransactionUtils.js b/cypress/support/pages/ordersTransactionUtils.js deleted file mode 100644 index 91af8b77a7b..00000000000 --- a/cypress/support/pages/ordersTransactionUtils.js +++ /dev/null @@ -1,116 +0,0 @@ -import { - BUTTON_SELECTORS, - ORDER_GRANT_REFUND, - ORDER_TRANSACTION_CREATE, - ORDERS_SELECTORS, - SHARED_ELEMENTS, -} from "../../elements"; - -export function markAsPaidOrderWithRefNumber(transactionNumber) { - cy.addAliasToGraphRequest("OrderMarkAsPaid"); - clickMarkAsPaidButton(); - typeTransactionReference(`ref_${transactionNumber}`); - clickConfirmMarkAsPaidButton().waitForRequestAndCheckIfNoErrors( - "@OrderMarkAsPaid", - ); -} -export function captureManualTransaction( - transactionDescription, - transactionPSPReference, - amount, -) { - clickCaptureManualTransactionButton(); - typeTransactionDescription(`desc_${transactionDescription}`); - typeTransactionPSPReference(`psp_${transactionPSPReference}`); - typeRefundTotalAmount(amount); - clickCreateManualTransactionButton().confirmationMessageShouldAppear(); -} -export function grantRefundAllProductsAndShippingWithReason( - refundReason, - total, -) { - cy.addAliasToGraphRequest("OrderDetailsGrantRefund"); - clickGrantRefundButton(); - cy.waitForRequestAndCheckIfNoErrors("@OrderDetailsGrantRefund"); - clickMaxQuantityButton(); - typeRefundReason(refundReason); - clickRefundShippingCheckbox(); - // this check makes sure no banner covers apply button which was making this action flaky - cy.get(SHARED_ELEMENTS.notificationMessage).should("not.exist"); - clickApplyRefundButton(); - cy.get(ORDER_GRANT_REFUND.refundAmountInput).should("contain.value", total); - clickConfirmRefundButton(); - cy.confirmationMessageShouldAppear(); -} -export function sendRefundWithDescriptionPSPAndAmount( - transactionDescription, - transactionPSPReference, - amount, -) { - clickSendRefundButton(); - typeTransactionDescription(`desc_${transactionDescription}`); - typeTransactionPSPReference(`psp_${transactionPSPReference}`); - typeRefundTotalAmount(amount); - cy.addAliasToGraphRequest("CreateManualTransactionRefund"); - clickRefundSubmitButton(); - cy.waitForRequestAndCheckIfNoErrors( - "@CreateManualTransactionRefund", - ).confirmationMessageShouldAppear(); -} -export function clickMarkAsPaidButton() { - return cy.clickOnElement(ORDERS_SELECTORS.markAsPaidButton); -} -export function clickRefundSubmitButton() { - return cy.clickOnElement(ORDER_TRANSACTION_CREATE.manualTransactionSubmit); -} -export function clickCreateManualTransactionButton() { - return cy.clickOnElement(ORDER_TRANSACTION_CREATE.manualTransactionSubmit); -} -export function clickMaxQuantityButton() { - return cy.clickOnElement(ORDER_GRANT_REFUND.setMaxQuantityButton); -} -export function clickCaptureManualTransactionButton() { - return cy.clickOnElement(ORDERS_SELECTORS.captureManualTransactionButton); -} -export function typeRefundReason(refundReasonDescription) { - return cy - .get(ORDER_GRANT_REFUND.refundReasonInput) - .type(`reason_${refundReasonDescription}`); -} -export function typeRefundTotalAmount(amount) { - return cy - .get(ORDER_TRANSACTION_CREATE.transactAmountInput) - .type(amount, { force: true }); -} -export function typeTransactionReference(reference) { - return cy.get(ORDERS_SELECTORS.transactionReferenceInput).type(reference); -} -export function typeTransactionDescription(transactionDescription) { - return cy - .get(ORDER_TRANSACTION_CREATE.transactionDescription) - .type(`desc_${transactionDescription}`); -} -export function typeTransactionPSPReference(transactionPSPReference) { - return cy - .get(ORDER_TRANSACTION_CREATE.transactionPspReference) - .type(`psp_${transactionPSPReference}`); -} -export function clickGrantRefundButton() { - return cy.clickOnElement(ORDERS_SELECTORS.grantRefundButton); -} -export function clickSendRefundButton() { - return cy.clickOnElement(ORDERS_SELECTORS.refundButton); -} -export function clickRefundShippingCheckbox() { - return cy.clickOnElement(ORDER_GRANT_REFUND.refundShippingCheckbox); -} -export function clickApplyRefundButton() { - return cy.clickOnElement(ORDER_GRANT_REFUND.applySelectedRefundButton); -} - -export function clickConfirmRefundButton() { - return cy.clickOnElement(ORDER_GRANT_REFUND.grantRefundButton); -} -export function clickConfirmMarkAsPaidButton() { - return cy.clickOnElement(BUTTON_SELECTORS.submit); -} diff --git a/cypress/support/pages/pageDetailsPage.js b/cypress/support/pages/pageDetailsPage.js deleted file mode 100644 index ef2ffcf545c..00000000000 --- a/cypress/support/pages/pageDetailsPage.js +++ /dev/null @@ -1,5 +0,0 @@ -import { PAGE_DETAILS_SELECTORS } from "../../elements/pages/page-details"; - -export function typePageName(pageName) { - return cy.get(PAGE_DETAILS_SELECTORS.nameInput).type(pageName); -} diff --git a/cypress/support/pages/pagesPage.js b/cypress/support/pages/pagesPage.js deleted file mode 100644 index 25349a3221e..00000000000 --- a/cypress/support/pages/pagesPage.js +++ /dev/null @@ -1,126 +0,0 @@ -import { PAGE_DETAILS_SELECTORS } from "../../elements/pages/page-details"; -import { PAGES_LIST_SELECTORS } from "../../elements/pages/pages-list"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { urlList } from "../../fixtures/urlList"; - -export const attributesTypes = { - DROPDOWN: addSelectAttributeValue, - MULTISELECT: addSelectAttributeValue, - RICH_TEXT: addRichTextAttributeValue, - BOOLEAN: addBooleanAttributeValue, - NUMERIC: addNumericAttributeValue, -}; - -export function fillUpPageTypeDialog({ pageTypeName }) { - const organization = {}; - return cy - .fillAutocompleteSelect( - PAGES_LIST_SELECTORS.dialogPageTypeInput, - pageTypeName, - ) - .then(selected => { - organization.pageType = selected; - return organization; - }); -} - -export function createPage({ - pageName, - pageTypeName, - isPublished = false, - attributeType = "DROPDOWN", - attributeValue, -}) { - openCreatePageAndFillUpGeneralFields({ pageName, pageTypeName, isPublished }); - attributesTypes[attributeType](attributeValue); - return savePage(); -} -export function createPageWithAttribute({ - pageName, - pageTypeName, - isPublished = false, - attributeType = "DROPDOWN", - attributeValue, -}) { - cy.get(PAGE_DETAILS_SELECTORS.nameInput).type(pageName); - if (!isPublished) { - cy.get(PAGE_DETAILS_SELECTORS.isNotPublishedCheckbox).click(); - } - attributesTypes[attributeType](attributeValue); - return savePage(); -} - -export function addSelectAttributeValue(attributeValue) { - cy.fillAutocompleteSelect( - PAGE_DETAILS_SELECTORS.attributeValues, - attributeValue, - ); -} - -export function addRichTextAttributeValue(attributeValue) { - cy.get(PAGE_DETAILS_SELECTORS.attributeValues) - .find(SHARED_ELEMENTS.richTextEditor.empty) - .should("exist") - .get(PAGE_DETAILS_SELECTORS.attributeValues) - .find(PAGE_DETAILS_SELECTORS.richTextEditorAttributeValue) - .type(attributeValue) - .wait(500); -} - -export function addBooleanAttributeValue() { - cy.get(PAGE_DETAILS_SELECTORS.booleanAttributeValueCheckbox).click(); -} - -export function addNumericAttributeValue(attributeValue) { - cy.get(PAGE_DETAILS_SELECTORS.numericAttributeValueInput).type( - attributeValue, - { force: true }, - ); -} - -function openCreatePageAndFillUpGeneralFields({ - pageName, - pageTypeName, - isPublished, -}) { - cy.visit(urlList.pages).get(PAGES_LIST_SELECTORS.createPageButton).click(); - - selectPageTypeName(pageTypeName); - cy.get(BUTTON_SELECTORS.confirmButton) - .click() - .get(PAGE_DETAILS_SELECTORS.nameInput) - .type(pageName); - if (!isPublished) { - cy.get(PAGE_DETAILS_SELECTORS.isNotPublishedCheckbox).click(); - } -} - -export function savePage() { - return cy - .addAliasToGraphRequest("PageCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@PageCreate") - .its("response.body.data.pageCreate.page"); -} -export function openCreatePageDialog() { - return cy.get(PAGES_LIST_SELECTORS.createPageButton).click(); -} -export function selectPageTypeOnIndex(index) { - cy.get(PAGES_LIST_SELECTORS.dialogPageTypeInput).click({ force: true }); - return cy - .get(PAGES_LIST_SELECTORS.dialogPageTypeInputOptions) - .eq(index) - .click({ force: true }); -} -export function selectPageTypeName(pageTypeName) { - cy.get(PAGES_LIST_SELECTORS.dialogPageTypeInput) - .click({ force: true }) - .type(pageTypeName); - return cy - .get(PAGES_LIST_SELECTORS.dialogPageTypeInputOptions) - .contains(pageTypeName) - .click({ force: true }); -} diff --git a/cypress/support/pages/permissionsPage.js b/cypress/support/pages/permissionsPage.js deleted file mode 100644 index 8a9214f7c2d..00000000000 --- a/cypress/support/pages/permissionsPage.js +++ /dev/null @@ -1,72 +0,0 @@ -import { MENU_SELECTORS } from "../../elements/account/left-menu/left-menu-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { urlList } from "../../fixtures/urlList"; - -export function navigateToAllAvailablePageAndCheckIfDisplayed({ - user, - permissions, -}) { - cy.loginUserViaRequest("auth", user).visit(urlList.homePage); - if (!permissions) { - return; - } - return permissions.forEach(permission => - permission.permissionSelectors.forEach(permissionSelector => { - if (permission.parent) { - cy.get(permission.parent.parentMenuSelector).click(); - } - return cy - .get(permissionSelector) - .click() - .then(() => { - isElementDisplayed().should("be.true"); - }); - }), - ); -} - -export function isElementDisplayed(element = SHARED_ELEMENTS.header) { - return cy.get("body").then(body => body.find(element).length > 0); -} - -export function getDisplayedSelectors(selectors = MENU_SELECTORS) { - const displayedSelectors = {}; - - cy.wrap(displayedSelectors).as("displayedSelectors"); - - Object.values(selectors).forEach((value, i) => - isElementDisplayed(value).then(isDisplayed => { - if (isDisplayed) { - cy.wrap(value); - - displayedSelectors["link" + i] = value; - - cy.wrap(displayedSelectors).as("displayedSelectors"); - } - }), - ); - return cy.get("@displayedSelectors"); -} - -export function expectAllSelectorsPermitted(permissions, selectors) { - Object.values(selectors).forEach(selector => { - const isSelectorPermitted = isPermitted(permissions, selector); - - expect(isSelectorPermitted, `${selector} selector should be in permitted`) - .to.be.true; - }); -} - -function isPermitted(permissions, selector) { - let permittedSelectors = [MENU_SELECTORS.home]; - - permissions.forEach(permission => { - if (permission.parent) { - permittedSelectors.push(permission.parent.parentMenuSelector); - } - permittedSelectors = permittedSelectors.concat( - permission.permissionSelectors, - ); - }); - return permittedSelectors.includes(selector); -} diff --git a/cypress/support/pages/productTypePage.js b/cypress/support/pages/productTypePage.js deleted file mode 100644 index 28364804549..00000000000 --- a/cypress/support/pages/productTypePage.js +++ /dev/null @@ -1,26 +0,0 @@ -import { PRODUCT_TYPE_DETAILS_SELECTORS } from "../../elements/productTypes/productTypeDetails"; -import { PRODUCT_TYPES_LIST_SELECTORS } from "../../elements/productTypes/productTypesList"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; - -export function createProductType({ name, shippingWeight, giftCard = false }) { - cy.get(PRODUCT_TYPES_LIST_SELECTORS.addProductTypeButton) - .click() - .waitForProgressBarToNotBeVisible() - .get(PRODUCT_TYPE_DETAILS_SELECTORS.nameInput) - .type(name); - if (giftCard) { - cy.get(PRODUCT_TYPE_DETAILS_SELECTORS.giftCardKindCheckbox).click(); - } - if (shippingWeight) { - cy.get(PRODUCT_TYPE_DETAILS_SELECTORS.isShippingRequired) - .click() - .get(PRODUCT_TYPE_DETAILS_SELECTORS.shippingWeightInput) - .type(shippingWeight); - } - return cy - .addAliasToGraphRequest("ProductTypeCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@ProductTypeCreate") - .its("response.body.data.productTypeCreate.productType"); -} diff --git a/cypress/support/pages/shippingMethodPage.js b/cypress/support/pages/shippingMethodPage.js deleted file mode 100644 index 2e13a47baa8..00000000000 --- a/cypress/support/pages/shippingMethodPage.js +++ /dev/null @@ -1,235 +0,0 @@ -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { SHIPPING_RATE_DETAILS } from "../../elements/shipping/shipping-rate-details"; -import { SHIPPING_ZONE_DETAILS } from "../../elements/shipping/shipping-zone-details"; -import { SHIPPING_ZONES_LIST_SELECTORS } from "../../elements/shipping/shipping-zones-list"; -import { WEIGHT_UNITS } from "../../fixtures/weightsUnits"; - -export function createShippingZone( - shippingName, - warehouseName, - country, - channelName, -) { - cy.get(SHIPPING_ZONES_LIST_SELECTORS.addShippingZone).click(); - fillUpShippingZoneData({ - shippingName, - warehouseName, - country, - channelName, - }); -} - -export function fillUpShippingZoneData({ - shippingName, - warehouseName, - country, - channelName, -}) { - cy.get(SHIPPING_ZONE_DETAILS.nameInput) - .clear() - .type(shippingName) - .get(SHIPPING_ZONE_DETAILS.descriptionInput) - .clear() - .type(shippingName) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear() - - .get(SHIPPING_ZONE_DETAILS.warehouseSelector) - .click() - .get(SHIPPING_ZONE_DETAILS.warehouseSelector) - .type(warehouseName) - .get(SHIPPING_ZONE_DETAILS.autocompleteContentDialog); - cy.contains(SHIPPING_ZONE_DETAILS.option, warehouseName) - .click({ force: true }) - .get(SHIPPING_ZONE_DETAILS.warehouseSelector) - .click() - .get(SHIPPING_ZONE_DETAILS.channelSelector) - .click() - .get(SHIPPING_ZONE_DETAILS.option) - .contains(channelName) - .click() - .get(SHIPPING_ZONE_DETAILS.assignCountryButton) - .click() - .get(SHIPPING_ZONE_DETAILS.searchInput) - .type(country); - return cy - .contains(SHIPPING_ZONE_DETAILS.tableRow, country) - .find(BUTTON_SELECTORS.checkbox) - .click() - .get(SHIPPING_ZONE_DETAILS.submitAssignCountry) - .click() - .addAliasToGraphRequest("UpdateShippingZone") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@UpdateShippingZone"); -} - -export function changeWeightUnit(weightUnit) { - cy.fillBaseSelect(SHIPPING_ZONES_LIST_SELECTORS.unitSelect, weightUnit) - .addAliasToGraphRequest("UpdateDefaultWeightUnit") - .get(SHIPPING_ZONES_LIST_SELECTORS.saveUnit) - .click() - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors("@UpdateDefaultWeightUnit") - .wait(5000); -} - -export function createShippingRate({ - rateName, - price, - rateOption, - weightLimits, - deliveryTime, - priceLimits, -}) { - enterAndFillUpShippingRate({ - rateName, - price, - rateOption, - weightLimits, - deliveryTime, - priceLimits, - }); - return saveRate(); -} - -export function enterAndFillUpShippingRate({ - rateName, - price, - rateOption, - weightLimits, - priceLimits, - deliveryTime, -}) { - cy.get(rateOption).click(); - fillUpShippingRate({ - rateName, - price, - weightLimits, - priceLimits, - deliveryTime, - }); -} - -export function fillUpShippingRate({ - rateName, - price, - weightLimits, - priceLimits, - deliveryTime, -}) { - cy.waitForProgressBarToNotBeVisible() - .get(SHARED_ELEMENTS.richTextEditor.empty) - .should("exist") - .get(SHIPPING_RATE_DETAILS.inputName) - .clearAndType(rateName); - if (deliveryTime) { - fillUpDeliveryTime(deliveryTime); - } - if (weightLimits) { - fillUpLimits(weightLimits); - } - if (priceLimits) { - fillUpLimits(priceLimits); - } - cy.get(SHIPPING_RATE_DETAILS.priceInput).each($priceInput => { - cy.wrap($priceInput) - .clear({ force: true }) - .get(SHARED_ELEMENTS.pageHeader) - .click() - .wrap($priceInput) - .clearAndType(price, { force: true }); - }); -} - -export function createRateWithPostalCode({ - rateName, - price, - rateOption = rateOptions.PRICE_OPTION, - minPostalCode, - maxPostalCode, - postalCodeOption, -}) { - enterAndFillUpShippingRate({ rateName, price, rateOption }); - cy.get(postalCodeOption) - .click() - .get(SHIPPING_RATE_DETAILS.addPostalCodesButton) - .click() - .get(SHIPPING_RATE_DETAILS.postalCodesForm.min) - .type(minPostalCode) - .get(SHIPPING_RATE_DETAILS.postalCodesForm.max) - .type(maxPostalCode) - .get(BUTTON_SELECTORS.submit) - .click(); - return saveRate(); -} - -export function saveRate() { - return cy - .addAliasToGraphRequest("ShippingMethodChannelListingUpdate") - .addAliasToGraphRequest("ShippingZone") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors(`@ShippingMethodChannelListingUpdate`) - .waitForRequestAndCheckIfNoErrors(`@ShippingZone`) - .its("response.body.data.shippingZone"); -} - -export function saveRateAfterUpdate() { - return cy - .addAliasToGraphRequest("ShippingMethodChannelListingUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear() - .waitForRequestAndCheckIfNoErrors(`@ShippingMethodChannelListingUpdate`); -} - -export function fillUpLimits({ max, min }) { - cy.get(SHIPPING_RATE_DETAILS.minValueInput) - .type(min, { force: true }) - .get(SHIPPING_RATE_DETAILS.maxValueInput) - .type(max, { force: true }); -} - -export function fillUpDeliveryTime({ min, max }) { - cy.get(SHIPPING_RATE_DETAILS.minDeliveryTimeInput) - .clearAndType(min, { force: true }) - .get(SHIPPING_RATE_DETAILS.maxDeliveryTimeInput) - .clearAndType(max, { force: true }); -} -export function openSettings() { - cy.get(SHIPPING_ZONES_LIST_SELECTORS.settingsButton).click(); -} -export function openChangeDefaultWeightDialog() { - openSettings(); - cy.get(SHIPPING_ZONES_LIST_SELECTORS.changeDefaultWeightUnitButton).click(); -} -export function getDifferentDefaultWeight() { - return cy - .get(SHIPPING_ZONES_LIST_SELECTORS.weightUnitSelector) - .invoke("text") - .then(defaultUnit => { - WEIGHT_UNITS.find(unit => { - unit !== defaultUnit; - }); - }); -} -export function selectDifferentDefaultWeight(unit) { - cy.get(SHIPPING_ZONES_LIST_SELECTORS.weightUnitSelector).click(); - cy.contains(unit).click(); - return cy.get(SHIPPING_ZONES_LIST_SELECTORS.saveUnitsButton).click(); -} - -export const rateOptions = { - PRICE_OPTION: SHIPPING_ZONE_DETAILS.addPriceRateButton, - WEIGHT_OPTION: SHIPPING_ZONE_DETAILS.addWeightRateButton, -}; - -export const postalCodesOptions = { - INCLUDE_OPTION: SHIPPING_RATE_DETAILS.includePostalCodesCheckbox, - EXCLUDE_OPTION: SHIPPING_RATE_DETAILS.excludePostalCodesCheckbox, -}; diff --git a/cypress/support/pages/shippingZones.js b/cypress/support/pages/shippingZones.js deleted file mode 100644 index 229c2e66314..00000000000 --- a/cypress/support/pages/shippingZones.js +++ /dev/null @@ -1,31 +0,0 @@ -import { SEARCH } from "../../elements/shared/"; -import { - SHIPPING_ZONE_CHECKBOX, - SHIPPING_ZONE_NAME, -} from "../../elements/shipping/shipping-zones-list"; -import { urlList } from "../../fixtures/urlList"; - -export function enterAndSelectShippings( - shippingIds, - actionFunction = selectShippingZone, -) { - cy.addAliasToGraphRequest("ShippingZones") - .visit(urlList.shippingMethods) - .findElementsAndMakeActionOnTable({ - elementsGraphqlAlias: "ShippingZones", - elementsName: "shippingZones", - elementsIds: shippingIds, - actionFunction, - }); -} - -export function selectShippingZone(id) { - cy.get(SHIPPING_ZONE_CHECKBOX(id)).click(); -} -export function typeShippingNameInSearch(methodName) { - cy.get(SEARCH.searchInput).click().type(methodName); -} - -export function enterShippingZone(id) { - cy.get(SHIPPING_ZONE_NAME(id)).click(); -} diff --git a/cypress/support/pages/siteSettings.js b/cypress/support/pages/siteSettings.js deleted file mode 100644 index 7eb303a6392..00000000000 --- a/cypress/support/pages/siteSettings.js +++ /dev/null @@ -1,21 +0,0 @@ -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SITE_SETTINGS_DETAILS } from "../../elements/siteSettings/site-settings-details"; -import { urlList } from "../../fixtures/urlList"; - -export function enterSiteSettingAndSetStockReservation(userType, stockAmount) { - cy.visitAndWaitForProgressBarToDisappear(urlList.siteSettings); - if (stockAmount) { - cy.get(userType).clearAndType(stockAmount); - } else { - cy.get(userType).clear(); - } - cy.addAliasToGraphRequest("ShopSettingsUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@ShopSettingsUpdate"); -} - -export const userType = { - anonymous: SITE_SETTINGS_DETAILS.stockReservationAnonymousUserInput, - authenticated: SITE_SETTINGS_DETAILS.stockReservationAuthenticatedUserInput, -}; diff --git a/cypress/support/pages/translationsPage.js b/cypress/support/pages/translationsPage.js deleted file mode 100644 index 7e7894e3121..00000000000 --- a/cypress/support/pages/translationsPage.js +++ /dev/null @@ -1,80 +0,0 @@ -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; -import { ELEMENT_TRANSLATION } from "../../elements/translations/element-translation"; -import { LANGUAGES_LIST_SELECTORS } from "../../elements/translations/languages-list"; -import { urlList } from "../../fixtures/urlList"; - -export function updateTranslationToCategory({ - categoryName, - translatedName, - translatedDescription, - translatedSeoTitle, - translatedSeoDescription, -}) { - cy.visit(urlList.translations); - enterCategoryTranslation( - LANGUAGES_LIST_SELECTORS.polishLanguageButton, - categoryName, - ); - cy.get(ELEMENT_TRANSLATION.editNameButton) - .click() - .get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(ELEMENT_TRANSLATION.translationInputField) - .clear() - .type(translatedName) - // .clearAndType(translatedName) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .get(ELEMENT_TRANSLATION.editDescriptionButton) - .click() - .get(SHARED_ELEMENTS.richTextEditor.loader) - .should("not.exist") - .get(ELEMENT_TRANSLATION.translationTextEditor) - .clearAndType(translatedDescription) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .get(ELEMENT_TRANSLATION.editSeoTitleButton) - .click() - .get(ELEMENT_TRANSLATION.translationInputField) - .clear() - .type(translatedSeoTitle) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .get(ELEMENT_TRANSLATION.editSeoDescriptionButton) - .click() - .get(ELEMENT_TRANSLATION.translationInputField) - .clear() - .type(translatedSeoDescription) - // .clearAndType(translatedSeoDescription) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); -} - -export function enterCategoryTranslation(language, categoryName) { - cy.addAliasToGraphRequest("CategoryTranslations"); - cy.get(language).click().waitForProgressBarToNotExist(); - getCategoryFromTable(categoryName); -} - -function getCategoryFromTable(categoryName) { - cy.get(SHARED_ELEMENTS.skeleton).should("not.exist"); - cy.wait("@CategoryTranslations") - .its("response.body.data.translations.edges") - .then(edges => { - const isCategoryInResp = edges.find( - edge => edge.node.category.name === categoryName, - ); - - if (isCategoryInResp) { - cy.contains(SHARED_ELEMENTS.tableRow, categoryName).click(); - } else { - cy.get(BUTTON_SELECTORS.nextPaginationButton).click(); - getCategoryFromTable(categoryName); - } - }); -} diff --git a/cypress/support/pages/userPage.js b/cypress/support/pages/userPage.js deleted file mode 100644 index 42f0006872b..00000000000 --- a/cypress/support/pages/userPage.js +++ /dev/null @@ -1,55 +0,0 @@ -import { SET_PASSWORD } from "../../elements/account/setPassword"; -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { INVITE_STAFF_MEMBER_FORM_SELECTORS } from "../../elements/staffMembers/inviteStaffMemberForm"; -import { STAFF_MEMBER_DETAILS_SELECTORS } from "../../elements/staffMembers/staffMemberDetails"; -import { userDetailsUrl } from "../../fixtures/urlList"; - -export function fillUpSetPassword(password) { - cy.get(SET_PASSWORD.confirmPasswordInput) - .type(password) - .get(SET_PASSWORD.passwordInput) - .type(password) - .addAliasToGraphRequest("setPassword") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@setPassword"); -} - -export function fillUpUserDetailsAndAddFirstPermission( - firstName, - lastName, - email, -) { - fillUpOnlyUserDetails(firstName, lastName, email); - cy.confirmationMessageShouldDisappear() - .fillAutocompleteSelect(STAFF_MEMBER_DETAILS_SELECTORS.permissionsSelect) - .get(STAFF_MEMBER_DETAILS_SELECTORS.permissionsSelect) - .find("input") - .first() - .type("{esc}", { force: true }) - .addAliasToGraphRequest("StaffMemberUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@StaffMemberUpdate"); -} - -export function fillUpOnlyUserDetails(firstName, lastName, email) { - cy.get(INVITE_STAFF_MEMBER_FORM_SELECTORS.firstNameInput) - .type(firstName) - .get(INVITE_STAFF_MEMBER_FORM_SELECTORS.lastNameInput) - .type(lastName) - .get(INVITE_STAFF_MEMBER_FORM_SELECTORS.emailInput) - .type(email) - .get(BUTTON_SELECTORS.submit) - .click(); -} - -export function updateUserActiveFlag(userId) { - cy.visitAndWaitForProgressBarToDisappear(userDetailsUrl(userId)) - .get(STAFF_MEMBER_DETAILS_SELECTORS.isActiveCheckBox) - .click() - .addAliasToGraphRequest("StaffMemberUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@StaffMemberUpdate"); -} diff --git a/cypress/support/pages/warehousePage.js b/cypress/support/pages/warehousePage.js deleted file mode 100644 index abee9d73ae7..00000000000 --- a/cypress/support/pages/warehousePage.js +++ /dev/null @@ -1,64 +0,0 @@ -import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { WAREHOUSES_DETAILS } from "../../elements/warehouses/warehouse-details"; -import { WAREHOUSES_LIST } from "../../elements/warehouses/warehouses-list"; -import { urlList, warehouseDetailsUrl } from "../../fixtures/urlList"; - -export function createWarehouse({ name, address }) { - return cy - .visit(urlList.warehouses) - .get(WAREHOUSES_LIST.createNewButton) - .click() - .get(WAREHOUSES_DETAILS.nameInput) - .type(name) - .fillUpBasicAddress(address) - .addAliasToGraphRequest("WarehouseCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@WarehouseCreate") - .its("response.body.data.createWarehouse.warehouse"); -} - -export function visitAndEnablePickup( - warehouseId, - pickup = enableAllWarehousesPickup -) { - cy.visit(warehouseDetailsUrl(warehouseId)); - pickup(); - return saveWarehouseAfterUpdate(); -} - -export function visitSetPublicStockAndEnablePickup( - warehouseId, - pickup = enableAllWarehousesPickup -) { - cy.visit(warehouseDetailsUrl(warehouseId)) - .get(WAREHOUSES_DETAILS.publicRadioButton) - .click(); - pickup(); - return saveWarehouseAfterUpdate(); -} - -export function enableAllWarehousesPickup() { - return cy - .get(WAREHOUSES_DETAILS.clickAndCollectAllWarehousesRadioButton) - .click(); -} - -export function enableLocalStockOnlyPickup() { - return cy - .get(WAREHOUSES_DETAILS.clickAndCollectLocalStockRadioButton) - .click(); -} - -function saveWarehouseAfterUpdate() { - return cy - .addAliasToGraphRequest("WarehouseUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .wait("@WarehouseUpdate"); -} - -export const pickupOptions = { - allWarehouses: enableAllWarehousesPickup, - local: enableLocalStockOnlyPickup -}; diff --git a/package-lock.json b/package-lock.json index 22be7b50c40..d57bc066f88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -144,9 +144,6 @@ "codecov": "^3.7.1", "core-js": "^3.7.0", "cross-env": "^6.0.3", - "cypress-multi-reporters": "^1.6.3", - "cypress-recurse": "^1.27.0", - "cypress-split": "^1.3.15", "dependency-cruiser": "^12.10.0", "dotenv": "^10.0.0", "env-var": "^7.3.0", @@ -202,13 +199,6 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^26.0.14", "@types/setup-polly-jest": "^0.5.0", - "cypress": "^12.17.0", - "cypress-file-upload": "^5.0.8", - "cypress-mailhog": "^1.3.0", - "cypress-mochawesome-reporter": "^3.5.1", - "cypress-multi-reporters": "^1.5.0", - "cypress-repeat": "^2.3.3", - "cypress-timings": "^1.0.0", "fsevents": "^1.2.9", "husky": "^8.0.3", "jest": "^27.5.1", @@ -226,34 +216,6 @@ "ts-jest": "^27.1.5" } }, - "node_modules/@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "dev": true, - "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "node_modules/@actions/core/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/@actions/http-client": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz", - "integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==", - "dev": true, - "dependencies": { - "tunnel": "^0.0.6" - } - }, "node_modules/@adobe/css-tools": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", @@ -1728,14 +1690,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -1758,89 +1712,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", - "optional": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "http-signature": "~1.3.6", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "performance-now": "^2.1.0", - "qs": "~6.10.3", - "safe-buffer": "^5.1.2", - "tough-cookie": "^4.1.3", - "tunnel-agent": "^0.6.0", - "uuid": "^8.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@cypress/request/node_modules/qs": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", - "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", - "optional": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/@cypress/request/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "optional": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/@cypress/xvfb": { - "version": "1.2.4", - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - } - }, - "node_modules/@cypress/xvfb/node_modules/debug": { - "version": "3.2.7", - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/@dependents/detective-less": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.1.0.tgz", - "integrity": "sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/@dessert-box/core": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@dessert-box/core/-/core-0.2.0.tgz", @@ -8613,16 +8484,6 @@ "@types/pollyjs__core": "*" } }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.1", - "license": "MIT", - "optional": true - }, - "node_modules/@types/sizzle": { - "version": "2.3.3", - "license": "MIT", - "optional": true - }, "node_modules/@types/stack-utils": { "version": "2.0.1", "license": "MIT", @@ -8686,14 +8547,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/@types/yauzl": { - "version": "2.10.0", - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/zen-observable": { "version": "0.8.3", "license": "MIT" @@ -9500,31 +9353,6 @@ "graphql": "14 - 16" } }, - "node_modules/app-module-path": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", - "integrity": "sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==", - "dev": true - }, - "node_modules/arch": { - "version": "2.2.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "optional": true - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -9690,15 +9518,6 @@ "dev": true, "license": "MIT" }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "optional": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, "node_modules/asn1js": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", @@ -9713,24 +9532,6 @@ "node": ">=12.0.0" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "optional": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/ast-module-types": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", - "integrity": "sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -9742,7 +9543,7 @@ }, "node_modules/async": { "version": "3.2.3", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/asynckit": { @@ -9750,14 +9551,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/at-least-node": { - "version": "1.0.0", - "license": "ISC", - "optional": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/attr-accept": { "version": "2.2.2", "license": "MIT", @@ -9787,21 +9580,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "optional": true - }, "node_modules/axios": { "version": "0.21.4", "dev": true, @@ -10002,7 +9780,7 @@ }, "node_modules/base64-js": { "version": "1.5.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -10019,15 +9797,6 @@ ], "license": "MIT" }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "optional": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/better-path-resolve": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", @@ -10089,14 +9858,9 @@ "ieee754": "^1.1.13" } }, - "node_modules/blob-util": { - "version": "2.0.2", - "license": "Apache-2.0", - "optional": true - }, "node_modules/bluebird": { "version": "3.7.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/boolbase": { @@ -10193,14 +9957,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "license": "MIT", - "optional": true, - "engines": { - "node": "*" - } - }, "node_modules/buffer-from": { "version": "1.1.1", "devOptional": true, @@ -10225,14 +9981,6 @@ "node": ">= 0.8" } }, - "node_modules/cachedir": { - "version": "2.3.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/call-bind": { "version": "1.0.2", "license": "MIT", @@ -10321,12 +10069,6 @@ "tslib": "^2.0.3" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "optional": true - }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -10464,7 +10206,7 @@ }, "node_modules/check-more-types": { "version": "2.24.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -10569,21 +10311,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", - "optional": true, - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, "node_modules/cli-truncate": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", @@ -10890,7 +10617,7 @@ "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "devOptional": true + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -10911,7 +10638,7 @@ }, "node_modules/common-tags": { "version": "1.8.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=4.0.0" @@ -10939,18 +10666,6 @@ "dev": true, "license": "MIT" }, - "node_modules/console.table": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", - "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", - "dev": true, - "dependencies": { - "easy-table": "1.1.0" - }, - "engines": { - "node": "> 0.10" - } - }, "node_modules/constant-case": { "version": "3.0.4", "dev": true, @@ -10998,11 +10713,6 @@ "url": "https://opencollective.com/core-js" } }, - "node_modules/core-util-is": { - "version": "1.0.2", - "license": "MIT", - "optional": true - }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -11263,404 +10973,6 @@ "node": ">=0.10.0" } }, - "node_modules/cypress": { - "version": "12.17.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.0.tgz", - "integrity": "sha512-nq0ug8Zrjq/2khHU1PTNxg+3/n1oqtmAFCxwQhS6QzkQ4mR6RLitX+cGIOuIMfnEbDAtVub0hZh661FOA16JxA==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@cypress/request": "^2.88.10", - "@cypress/xvfb": "^1.2.4", - "@types/node": "^14.14.31", - "@types/sinonjs__fake-timers": "8.1.1", - "@types/sizzle": "^2.3.2", - "arch": "^2.2.0", - "blob-util": "^2.0.2", - "bluebird": "^3.7.2", - "buffer": "^5.6.0", - "cachedir": "^2.3.0", - "chalk": "^4.1.0", - "check-more-types": "^2.24.0", - "cli-cursor": "^3.1.0", - "cli-table3": "~0.6.1", - "commander": "^6.2.1", - "common-tags": "^1.8.0", - "dayjs": "^1.10.4", - "debug": "^4.3.4", - "enquirer": "^2.3.6", - "eventemitter2": "6.4.7", - "execa": "4.1.0", - "executable": "^4.1.1", - "extract-zip": "2.0.1", - "figures": "^3.2.0", - "fs-extra": "^9.1.0", - "getos": "^3.2.1", - "is-ci": "^3.0.0", - "is-installed-globally": "~0.4.0", - "lazy-ass": "^1.6.0", - "listr2": "^3.8.3", - "lodash": "^4.17.21", - "log-symbols": "^4.0.0", - "minimist": "^1.2.8", - "ospath": "^1.2.2", - "pretty-bytes": "^5.6.0", - "proxy-from-env": "1.0.0", - "request-progress": "^3.0.0", - "semver": "^7.5.3", - "supports-color": "^8.1.1", - "tmp": "~0.2.1", - "untildify": "^4.0.0", - "yauzl": "^2.10.0" - }, - "bin": { - "cypress": "bin/cypress" - }, - "engines": { - "node": "^14.0.0 || ^16.0.0 || >=18.0.0" - } - }, - "node_modules/cypress-file-upload": { - "version": "5.0.8", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8.2.1" - }, - "peerDependencies": { - "cypress": ">3.0.0" - } - }, - "node_modules/cypress-mailhog": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/cypress-mailhog/-/cypress-mailhog-1.7.0.tgz", - "integrity": "sha512-OBk27OYm4slL5lCtphlHTlFPnrDEmuMeqSTch4/uk92iPzh8+gS4Y1KAmMiZsSDGjQzXi/7Ab5QWo6xmq8evXg==", - "optional": true - }, - "node_modules/cypress-mochawesome-reporter": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.5.1.tgz", - "integrity": "sha512-/5ahFTyTxLujdzfTvmQrzKrJ8GWv12rUbOHvzWfVRYlAp/088ffU/1QbcfacEa2HTs28onSIIBiIKqSOID/bTw==", - "optional": true, - "dependencies": { - "fs-extra": "^10.0.1", - "mochawesome": "^7.1.3", - "mochawesome-merge": "^4.2.1", - "mochawesome-report-generator": "^6.2.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/LironEr" - }, - "peerDependencies": { - "cypress": ">=6.2.0" - } - }, - "node_modules/cypress-mochawesome-reporter/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cypress-mochawesome-reporter/node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "optional": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/cypress-mochawesome-reporter/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "optional": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/cypress-multi-reporters": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/cypress-multi-reporters/-/cypress-multi-reporters-1.6.3.tgz", - "integrity": "sha512-klb9pf6oAF4WCLHotu9gdB8ukYBdeTzbEMuESKB3KT54HhrZj65vQxubAgrULV5H2NWqxHdUhlntPbKZChNvEw==", - "dev": true, - "dependencies": { - "debug": "^4.3.4", - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=6.0.0" - }, - "peerDependencies": { - "mocha": ">=3.1.2" - } - }, - "node_modules/cypress-recurse": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/cypress-recurse/-/cypress-recurse-1.27.0.tgz", - "integrity": "sha512-BCD83UqaxlD+JiqZn1PvIhHRXasgfCt57vLC1Fcyifvxh4QklELRcYUJV3MdhKamMkmajaErLfnCNbZ8VJ5SIg==", - "dev": true, - "dependencies": { - "humanize-duration": "^3.27.3" - } - }, - "node_modules/cypress-repeat": { - "version": "2.3.3", - "license": "MIT", - "optional": true, - "dependencies": { - "arg": "5.0.2", - "bluebird": "3.7.2", - "debug": "4.3.4", - "dotenv": "8.2.0" - }, - "bin": { - "cypress-repeat": "index.js" - }, - "peerDependencies": { - "cypress": ">=5.3.0" - } - }, - "node_modules/cypress-repeat/node_modules/arg": { - "version": "5.0.2", - "license": "MIT", - "optional": true - }, - "node_modules/cypress-repeat/node_modules/dotenv": { - "version": "8.2.0", - "license": "BSD-2-Clause", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cypress-split": { - "version": "1.3.15", - "resolved": "https://registry.npmjs.org/cypress-split/-/cypress-split-1.3.15.tgz", - "integrity": "sha512-5YZtBzNX72OZDE6Kl6cqKMpeMmPRJIl8EOZXBv8METW1wyaOJJwYxHXYEObZ85IILmXyfkH0HtDWDLM8Ez/Snw==", - "dev": true, - "dependencies": { - "@actions/core": "^1.10.0", - "console.table": "^0.10.0", - "debug": "^4.3.4", - "find-cypress-specs": "1.35.1", - "humanize-duration": "^3.28.0" - } - }, - "node_modules/cypress-timings": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, - "node_modules/cypress/node_modules/@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", - "optional": true - }, - "node_modules/cypress/node_modules/buffer": { - "version": "5.7.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/cypress/node_modules/chalk": { - "version": "4.1.2", - "license": "MIT", - "optional": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cypress/node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "license": "MIT", - "optional": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cypress/node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "optional": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/cypress/node_modules/fs-extra": { - "version": "9.1.0", - "license": "MIT", - "optional": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cypress/node_modules/has-flag": { - "version": "4.0.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cypress/node_modules/jsonfile": { - "version": "6.1.0", - "license": "MIT", - "optional": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/cypress/node_modules/listr2": { - "version": "3.14.0", - "license": "MIT", - "optional": true, - "dependencies": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", - "rfdc": "^1.3.0", - "rxjs": "^7.5.1", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } - } - }, - "node_modules/cypress/node_modules/p-map": { - "version": "4.0.0", - "license": "MIT", - "optional": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cypress/node_modules/proxy-from-env": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, - "node_modules/cypress/node_modules/rxjs": { - "version": "7.5.5", - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/cypress/node_modules/supports-color": { - "version": "8.1.1", - "license": "MIT", - "optional": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/cypress/node_modules/tmp": { - "version": "0.2.1", - "license": "MIT", - "optional": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/cypress/node_modules/universalify": { - "version": "2.0.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/data-urls": { "version": "2.0.0", "license": "MIT", @@ -11682,17 +10994,12 @@ }, "node_modules/dateformat": { "version": "4.6.3", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": "*" } }, - "node_modules/dayjs": { - "version": "1.11.2", - "license": "MIT", - "optional": true - }, "node_modules/debounce": { "version": "1.2.1", "dev": true, @@ -11716,7 +11023,7 @@ }, "node_modules/decamelize": { "version": "1.2.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -12069,33 +11376,6 @@ "node": ">= 0.6.0" } }, - "node_modules/dependency-tree": { - "version": "10.0.9", - "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-10.0.9.tgz", - "integrity": "sha512-dwc59FRIsht+HfnTVM0BCjJaEWxdq2YAvEDy4/Hn6CwS3CBWMtFnL3aZGAkQn3XCYxk/YcTDE4jX2Q7bFTwCjA==", - "dev": true, - "dependencies": { - "commander": "^10.0.1", - "filing-cabinet": "^4.1.6", - "precinct": "^11.0.5", - "typescript": "^5.0.4" - }, - "bin": { - "dependency-tree": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/dependency-tree/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -12125,113 +11405,6 @@ "version": "1.1.0", "license": "MIT" }, - "node_modules/detective-amd": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.2.tgz", - "integrity": "sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "escodegen": "^2.0.0", - "get-amd-module-type": "^5.0.1", - "node-source-walk": "^6.0.1" - }, - "bin": { - "detective-amd": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-cjs": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-5.0.1.tgz", - "integrity": "sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-es6": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-4.0.1.tgz", - "integrity": "sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==", - "dev": true, - "dependencies": { - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-postcss": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", - "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", - "dev": true, - "dependencies": { - "is-url": "^1.2.4", - "postcss": "^8.4.23", - "postcss-values-parser": "^6.0.2" - }, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/detective-sass": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-5.0.3.tgz", - "integrity": "sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-scss": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-4.0.3.tgz", - "integrity": "sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-stylus": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-4.0.0.tgz", - "integrity": "sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/detective-typescript": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.1.0.tgz", - "integrity": "sha512-Mq8egjnW2NSCkzEb/Az15/JnBI/Ryyl6Po0Y+0mABTFvOS6DAyUGRZqz1nyhu4QJmWWe0zaGs/ITIBeWkvCkGw==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "^5.59.5", - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1", - "typescript": "^5.0.4" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, "node_modules/diff": { "version": "4.0.2", "dev": true, @@ -12446,25 +11619,6 @@ "dev": true, "license": "MIT" }, - "node_modules/easy-table": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", - "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", - "dev": true, - "optionalDependencies": { - "wcwidth": ">=1.0.1" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "optional": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/editorjs-inline-tool": { "version": "0.4.0", "license": "MIT", @@ -12524,19 +11678,6 @@ "once": "^1.4.0" } }, - "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/enquirer": { "version": "2.3.6", "devOptional": true, @@ -13361,7 +12502,7 @@ }, "node_modules/escape-html": { "version": "1.0.3", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/escape-string-regexp": { @@ -13375,7 +12516,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "devOptional": true, + "optional": true, "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", @@ -14534,11 +13675,6 @@ "through": "~2.3.1" } }, - "node_modules/eventemitter2": { - "version": "6.4.7", - "license": "MIT", - "optional": true - }, "node_modules/execa": { "version": "4.1.0", "devOptional": true, @@ -14561,25 +13697,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/executable": { - "version": "4.1.1", - "license": "MIT", - "optional": true, - "dependencies": { - "pify": "^2.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/executable/node_modules/pify": { - "version": "2.3.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/exenv": { "version": "1.2.2", "license": "BSD-3-Clause" @@ -14638,34 +13755,6 @@ "url": "https://github.com/sponsors/jaydenseric" } }, - "node_modules/extract-zip": { - "version": "2.0.1", - "license": "BSD-2-Clause", - "optional": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ], - "optional": true - }, "node_modules/faker": { "version": "5.5.2", "license": "MIT" @@ -14794,14 +13883,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "license": "MIT", - "optional": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/fflate": { "version": "0.4.8", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", @@ -14875,55 +13956,6 @@ "node": ">=10" } }, - "node_modules/filing-cabinet": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-4.1.6.tgz", - "integrity": "sha512-C+HZbuQTER36sKzGtUhrAPAoK6+/PrrUhYDBQEh3kBRdsyEhkLbp1ML8S0+6e6gCUrUlid+XmubxJrhvL2g/Zw==", - "dev": true, - "dependencies": { - "app-module-path": "^2.2.0", - "commander": "^10.0.1", - "enhanced-resolve": "^5.14.1", - "is-relative-path": "^1.0.2", - "module-definition": "^5.0.1", - "module-lookup-amd": "^8.0.5", - "resolve": "^1.22.3", - "resolve-dependency-path": "^3.0.2", - "sass-lookup": "^5.0.1", - "stylus-lookup": "^5.0.1", - "tsconfig-paths": "^4.2.0", - "typescript": "^5.0.4" - }, - "bin": { - "filing-cabinet": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/filing-cabinet/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/filing-cabinet/node_modules/tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", - "dev": true, - "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/fill-range": { "version": "7.0.1", "license": "MIT", @@ -14934,44 +13966,6 @@ "node": ">=8" } }, - "node_modules/find-cypress-specs": { - "version": "1.35.1", - "resolved": "https://registry.npmjs.org/find-cypress-specs/-/find-cypress-specs-1.35.1.tgz", - "integrity": "sha512-ngLPf/U/I8jAS6vn5ljClETa6seG+fmr3oXw6BcYX3xVIk7D8jNljHUIJCTDvnK90XOI1cflYGuNFDezhRBNvQ==", - "dev": true, - "dependencies": { - "@actions/core": "^1.10.0", - "arg": "^5.0.1", - "console.table": "^0.10.0", - "debug": "^4.3.3", - "find-test-names": "1.28.13", - "globby": "^11.1.0", - "minimatch": "^3.0.4", - "pluralize": "^8.0.0", - "require-and-forget": "^1.0.1", - "shelljs": "^0.8.5", - "spec-change": "^1.7.1", - "ts-node": "^10.9.1" - }, - "bin": { - "find-cypress-specs": "bin/find.js" - } - }, - "node_modules/find-cypress-specs/node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "node_modules/find-cypress-specs/node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/find-root": { "version": "1.1.0", "license": "MIT" @@ -15137,29 +14131,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/from": { "version": "0.1.7", "dev": true, @@ -15213,7 +14184,7 @@ }, "node_modules/fsu": { "version": "1.1.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/function-bind": { @@ -15259,19 +14230,6 @@ "node": ">=6.9.0" } }, - "node_modules/get-amd-module-type": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-5.0.1.tgz", - "integrity": "sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "devOptional": true, @@ -15301,8 +14259,8 @@ }, "node_modules/get-own-enumerable-property-symbols": { "version": "3.0.2", - "devOptional": true, - "license": "ISC" + "license": "ISC", + "optional": true }, "node_modules/get-package-type": { "version": "0.1.0", @@ -15341,23 +14299,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/getos": { - "version": "3.2.1", - "license": "MIT", - "optional": true, - "dependencies": { - "async": "^3.2.0" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/github-buttons": { "version": "2.22.1", "license": "BSD-2-Clause" @@ -15393,7 +14334,7 @@ }, "node_modules/global-dirs": { "version": "3.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ini": "2.0.0" @@ -15407,7 +14348,7 @@ }, "node_modules/global-dirs/node_modules/ini": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -15439,21 +14380,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gonzales-pe": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", - "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "gonzales": "bin/gonzales.js" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/graceful-fs": { "version": "4.2.10", "devOptional": true, @@ -15959,20 +14885,6 @@ "node": ">= 6" } }, - "node_modules/http-signature": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", - "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^2.0.2", - "sshpk": "^1.14.1" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.0", "license": "MIT", @@ -15998,12 +14910,6 @@ "node": ">=8.12.0" } }, - "node_modules/humanize-duration": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.28.0.tgz", - "integrity": "sha512-jMAxraOOmHuPbffLVDKkEKi/NeG8dMqP8lGRd6Tbf7JgAeG33jjgPWDbXXU7ypCI0o+oNKJFgbSB9FKVdWNI2A==", - "dev": true - }, "node_modules/husky": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", @@ -16047,7 +14953,7 @@ }, "node_modules/ieee754": { "version": "1.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -16328,14 +15234,6 @@ "node": ">= 0.4" } }, - "node_modules/interpret": { - "version": "1.4.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/intl-messageformat": { "version": "9.12.0", "license": "BSD-3-Clause", @@ -16423,7 +15321,7 @@ }, "node_modules/is-ci": { "version": "3.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ci-info": "^3.2.0" @@ -16494,7 +15392,7 @@ }, "node_modules/is-installed-globally": { "version": "0.4.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", @@ -16562,15 +15460,15 @@ }, "node_modules/is-obj": { "version": "1.0.1", - "devOptional": true, "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-path-inside": { "version": "3.0.3", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -16616,8 +15514,8 @@ }, "node_modules/is-regexp": { "version": "1.0.0", - "devOptional": true, "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } @@ -16633,12 +15531,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-relative-path": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-relative-path/-/is-relative-path-1.0.2.tgz", - "integrity": "sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA==", - "dev": true - }, "node_modules/is-set": { "version": "2.0.2", "license": "MIT", @@ -16763,18 +15655,6 @@ "version": "1.2.4", "license": "MIT" }, - "node_modules/is-url-superb": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", - "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakmap": { "version": "2.0.1", "license": "MIT", @@ -16838,12 +15718,6 @@ "ws": "*" } }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "optional": true - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "license": "BSD-3-Clause", @@ -18292,12 +17166,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "optional": true - }, "node_modules/jsdom": { "version": "16.7.0", "license": "MIT", @@ -18389,11 +17257,6 @@ "version": "2.3.1", "license": "MIT" }, - "node_modules/json-schema": { - "version": "0.4.0", - "license": "(AFL-2.1 OR BSD-3-Clause)", - "optional": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, @@ -18414,7 +17277,7 @@ }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/json-to-pretty-yaml": { @@ -18448,7 +17311,7 @@ }, "node_modules/jsonfile": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "optionalDependencies": { "graceful-fs": "^4.1.6" @@ -18459,21 +17322,6 @@ "dev": true, "license": "Public Domain" }, - "node_modules/jsprim": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", - "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", - "engines": [ - "node >=0.6.0" - ], - "optional": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, "node_modules/jss": { "version": "9.8.7", "hasInstallScript": true, @@ -18928,7 +17776,7 @@ }, "node_modules/lazy-ass": { "version": "1.6.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": "> 0.8" @@ -19139,22 +17987,22 @@ }, "node_modules/lodash.isempty": { "version": "4.4.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isfunction": { "version": "3.0.9", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isobject": { "version": "3.0.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.memoize": { @@ -19167,11 +18015,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.once": { - "version": "4.1.1", - "license": "MIT", - "optional": true - }, "node_modules/lodash.startcase": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", @@ -20693,7 +19536,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/mochawesome/-/mochawesome-7.1.3.tgz", "integrity": "sha512-Vkb3jR5GZ1cXohMQQ73H3cZz7RoxGjjUo0G5hu0jLaW+0FdUxUwg3Cj29bqQdh0rFcnyV06pWmqmi5eBPnEuNQ==", - "devOptional": true, + "dev": true, "dependencies": { "chalk": "^4.1.2", "diff": "^5.0.0", @@ -20714,7 +19557,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/mochawesome-merge/-/mochawesome-merge-4.3.0.tgz", "integrity": "sha512-1roR6g+VUlfdaRmL8dCiVpKiaUhbPVm1ZQYUM6zHX46mWk+tpsKVZR6ba98k2zc8nlPvYd71yn5gyH970pKBSw==", - "devOptional": true, + "dev": true, "dependencies": { "fs-extra": "^7.0.1", "glob": "^7.1.6", @@ -20729,7 +19572,7 @@ }, "node_modules/mochawesome-merge/node_modules/cliui": { "version": "6.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -20739,7 +19582,7 @@ }, "node_modules/mochawesome-merge/node_modules/find-up": { "version": "4.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -20751,7 +19594,7 @@ }, "node_modules/mochawesome-merge/node_modules/fs-extra": { "version": "7.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", @@ -20764,7 +19607,7 @@ }, "node_modules/mochawesome-merge/node_modules/locate-path": { "version": "5.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -20775,7 +19618,7 @@ }, "node_modules/mochawesome-merge/node_modules/p-locate": { "version": "4.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -20786,7 +19629,7 @@ }, "node_modules/mochawesome-merge/node_modules/path-exists": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -20794,7 +19637,7 @@ }, "node_modules/mochawesome-merge/node_modules/strip-ansi": { "version": "6.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -20805,7 +19648,7 @@ }, "node_modules/mochawesome-merge/node_modules/wrap-ansi": { "version": "6.2.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -20818,7 +19661,7 @@ }, "node_modules/mochawesome-merge/node_modules/yargs": { "version": "15.4.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "cliui": "^6.0.0", @@ -20839,7 +19682,7 @@ }, "node_modules/mochawesome-merge/node_modules/yargs-parser": { "version": "18.1.3", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "camelcase": "^5.0.0", @@ -20853,7 +19696,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/mochawesome-report-generator/-/mochawesome-report-generator-6.2.0.tgz", "integrity": "sha512-Ghw8JhQFizF0Vjbtp9B0i//+BOkV5OWcQCPpbO0NGOoxV33o+gKDYU0Pr2pGxkIHnqZ+g5mYiXF7GMNgAcDpSg==", - "devOptional": true, + "dev": true, "dependencies": { "chalk": "^4.1.2", "dateformat": "^4.5.1", @@ -20874,7 +19717,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/chalk": { "version": "4.1.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -20889,7 +19732,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/fs-extra": { "version": "10.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", @@ -20902,7 +19745,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/has-flag": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -20910,7 +19753,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/jsonfile": { "version": "6.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "universalify": "^2.0.0" @@ -20921,7 +19764,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/supports-color": { "version": "7.2.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -20932,7 +19775,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/universalify": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 10.0.0" @@ -20940,7 +19783,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/y18n": { "version": "5.0.8", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -20948,7 +19791,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/yargs": { "version": "17.3.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "cliui": "^7.0.2", @@ -20965,7 +19808,7 @@ }, "node_modules/mochawesome-report-generator/node_modules/yargs-parser": { "version": "21.0.1", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -20975,7 +19818,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -20989,7 +19832,7 @@ }, "node_modules/mochawesome/node_modules/diff": { "version": "5.0.0", - "devOptional": true, + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -20999,7 +19842,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -21008,7 +19851,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -21020,7 +19863,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -21030,55 +19873,12 @@ }, "node_modules/mochawesome/node_modules/uuid": { "version": "8.3.2", - "devOptional": true, + "dev": true, "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, - "node_modules/module-definition": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-5.0.1.tgz", - "integrity": "sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - }, - "bin": { - "module-definition": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/module-lookup-amd": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-8.0.5.tgz", - "integrity": "sha512-vc3rYLjDo5Frjox8NZpiyLXsNWJ5BWshztc/5KSOMzpg9k5cHH652YsJ7VKKmtM4SvaxuE9RkrYGhiSjH3Ehow==", - "dev": true, - "dependencies": { - "commander": "^10.0.1", - "glob": "^7.2.3", - "requirejs": "^2.3.6", - "requirejs-config-file": "^4.0.0" - }, - "bin": { - "lookup-amd": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/module-lookup-amd/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -21269,18 +20069,6 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, - "node_modules/node-source-walk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.2.tgz", - "integrity": "sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.21.8" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/normalize-package-data": { "version": "2.5.0", "dev": true, @@ -21471,7 +20259,7 @@ }, "node_modules/opener": { "version": "1.5.2", - "devOptional": true, + "dev": true, "license": "(WTFPL OR MIT)", "bin": { "opener": "bin/opener-bin.js" @@ -21570,11 +20358,6 @@ "node": ">=0.10.0" } }, - "node_modules/ospath": { - "version": "1.2.2", - "license": "MIT", - "optional": true - }, "node_modules/outdent": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", @@ -21795,16 +20578,6 @@ "through": "~2.3" } }, - "node_modules/pend": { - "version": "1.2.0", - "license": "MIT", - "optional": true - }, - "node_modules/performance-now": { - "version": "2.1.0", - "license": "MIT", - "optional": true - }, "node_modules/picocolors": { "version": "1.0.0", "license": "ISC" @@ -21983,23 +20756,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-values-parser": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", - "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", - "dev": true, - "dependencies": { - "color-name": "^1.1.4", - "is-url-superb": "^4.0.0", - "quote-unquote": "^1.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "postcss": "^8.2.9" - } - }, "node_modules/posthog-js": { "version": "1.105.9", "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.105.9.tgz", @@ -22018,41 +20774,6 @@ "url": "https://opencollective.com/preact" } }, - "node_modules/precinct": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.5.tgz", - "integrity": "sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==", - "dev": true, - "dependencies": { - "@dependents/detective-less": "^4.1.0", - "commander": "^10.0.1", - "detective-amd": "^5.0.2", - "detective-cjs": "^5.0.1", - "detective-es6": "^4.0.1", - "detective-postcss": "^6.1.3", - "detective-sass": "^5.0.3", - "detective-scss": "^4.0.3", - "detective-stylus": "^4.0.0", - "detective-typescript": "^11.1.0", - "module-definition": "^5.0.1", - "node-source-walk": "^6.0.2" - }, - "bin": { - "precinct": "bin/cli.js" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/precinct/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/preferred-pm": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz", @@ -22164,17 +20885,6 @@ "node": ">=6.0.0" } }, - "node_modules/pretty-bytes": { - "version": "5.6.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/pretty-format": { "version": "27.5.1", "license": "MIT", @@ -22415,12 +21125,6 @@ } ] }, - "node_modules/quote-unquote": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", - "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", - "dev": true - }, "node_modules/randombytes": { "version": "2.1.0", "dev": true, @@ -23056,16 +21760,6 @@ "node": ">=8.10.0" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/redent": { "version": "3.0.0", "devOptional": true, @@ -23333,26 +22027,6 @@ "dev": true, "license": "MIT" }, - "node_modules/request-progress": { - "version": "3.0.0", - "license": "MIT", - "optional": true, - "dependencies": { - "throttleit": "^1.0.0" - } - }, - "node_modules/require-and-forget": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-and-forget/-/require-and-forget-1.0.1.tgz", - "integrity": "sha512-Sea861D/seGo3cptxc857a34Df0oEijXit8Q3IDodiwZMzVmyXrRI9EgQQa3hjkhoEjNzCBvv0t/0fMgebmWLg==", - "dev": true, - "dependencies": { - "debug": "4.3.4" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/require-context.macro": { "version": "1.2.2", "dev": true, @@ -23382,34 +22056,8 @@ }, "node_modules/require-main-filename": { "version": "2.0.0", - "devOptional": true, - "license": "ISC" - }, - "node_modules/requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", - "dev": true, - "bin": { - "r_js": "bin/r.js", - "r.js": "bin/r.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/requirejs-config-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", - "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", "dev": true, - "dependencies": { - "esprima": "^4.0.0", - "stringify-object": "^3.2.1" - }, - "engines": { - "node": ">=10.13.0" - } + "license": "ISC" }, "node_modules/requires-port": { "version": "1.0.0", @@ -23438,15 +22086,6 @@ "node": ">=8" } }, - "node_modules/resolve-dependency-path": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/resolve-dependency-path/-/resolve-dependency-path-3.0.2.tgz", - "integrity": "sha512-Tz7zfjhLfsvR39ADOSk9us4421J/1ztVBo4rWUkF38hgHK5m0OCZ3NxFVpqHRkjctnwVa15igEUHFJp8MCS7vA==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -23509,7 +22148,7 @@ }, "node_modules/rfdc": { "version": "1.3.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/rimraf": { @@ -23628,7 +22267,7 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -23663,30 +22302,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/sass-lookup": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/sass-lookup/-/sass-lookup-5.0.1.tgz", - "integrity": "sha512-t0X5PaizPc2H4+rCwszAqHZRtr4bugo4pgiCvrBFvIX0XFxnr29g77LJcpyj9A0DcKf7gXMLcgvRjsonYI6x4g==", - "dev": true, - "dependencies": { - "commander": "^10.0.1" - }, - "bin": { - "sass-lookup": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/sass-lookup/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -23763,7 +22378,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/setimmediate": { @@ -23817,23 +22432,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/side-channel": { "version": "1.0.4", "license": "MIT", @@ -24152,37 +22750,6 @@ "dev": true, "license": "CC0-1.0" }, - "node_modules/spec-change": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/spec-change/-/spec-change-1.7.1.tgz", - "integrity": "sha512-bZmtSmS5w6M6Snae+AGp+y89MZ7QG2SZW1v3Au83+YWcZzCu0YtH2hXruJWXg6VdYUpQ3n+m9bRrWmwLaPkFjQ==", - "dev": true, - "dependencies": { - "arg": "^5.0.2", - "debug": "^4.3.4", - "dependency-tree": "^10.0.9", - "globby": "^11.1.0", - "lazy-ass": "^2.0.3" - }, - "bin": { - "spec-change": "bin/spec-change.js" - } - }, - "node_modules/spec-change/node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "node_modules/spec-change/node_modules/lazy-ass": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-2.0.3.tgz", - "integrity": "sha512-/O3/DoQmI1XAhklDvF1dAjFf/epE8u3lzOZegQfLZ8G7Ud5bTRSZiFOpukHCu6jODrCA4gtIdwUCC7htxcDACA==", - "dev": true, - "engines": { - "node": "> 0.8" - } - }, "node_modules/split": { "version": "0.3.3", "dev": true, @@ -24206,31 +22773,6 @@ "version": "1.0.3", "license": "BSD-3-Clause" }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "optional": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/stack-utils": { "version": "2.0.6", "license": "MIT", @@ -24480,8 +23022,8 @@ }, "node_modules/stringify-object": { "version": "3.3.0", - "devOptional": true, "license": "BSD-2-Clause", + "optional": true, "dependencies": { "get-own-enumerable-property-symbols": "^3.0.0", "is-obj": "^1.0.1", @@ -24565,30 +23107,6 @@ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz", "integrity": "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" }, - "node_modules/stylus-lookup": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stylus-lookup/-/stylus-lookup-5.0.1.tgz", - "integrity": "sha512-tLtJEd5AGvnVy4f9UHQMw4bkJJtaAcmo54N+ovQBjDY3DuWyK9Eltxzr5+KG0q4ew6v2EHyuWWNnHeiw/Eo7rQ==", - "dev": true, - "dependencies": { - "commander": "^10.0.1" - }, - "bin": { - "stylus-lookup": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/stylus-lookup/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/supports-color": { "version": "5.5.0", "license": "MIT", @@ -24685,12 +23203,12 @@ }, "node_modules/tcomb": { "version": "3.2.29", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/tcomb-validation": { "version": "3.4.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "tcomb": "^3.0.0" @@ -24846,11 +23364,6 @@ "node": ">=8" } }, - "node_modules/throttleit": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/through": { "version": "2.3.8", "devOptional": true, @@ -25268,33 +23781,6 @@ "node": ">=12" } }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "dev": true, - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "optional": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "optional": true - }, "node_modules/type-detect": { "version": "4.0.8", "license": "MIT", @@ -25562,7 +24048,7 @@ }, "node_modules/universalify": { "version": "0.1.2", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 4.0.0" @@ -25600,14 +24086,6 @@ "node": ">= 0.8" } }, - "node_modules/untildify": { - "version": "4.0.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", @@ -25844,7 +24322,7 @@ }, "node_modules/validator": { "version": "13.7.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.10" @@ -25863,20 +24341,6 @@ "node": ">=12" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -26468,7 +24932,7 @@ }, "node_modules/which-module": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/which-pm": { @@ -26636,7 +25100,7 @@ }, "node_modules/y18n": { "version": "4.0.3", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/yallist": { @@ -26741,15 +25205,6 @@ "node": ">=10" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "license": "MIT", - "optional": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -26800,33 +25255,6 @@ } }, "dependencies": { - "@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "dev": true, - "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - }, - "dependencies": { - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - } - } - }, - "@actions/http-client": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz", - "integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==", - "dev": true, - "requires": { - "tunnel": "^0.0.6" - } - }, "@adobe/css-tools": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", @@ -27937,10 +26365,6 @@ } } }, - "@colors/colors": { - "version": "1.5.0", - "optional": true - }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -27962,76 +26386,6 @@ } } }, - "@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "http-signature": "~1.3.6", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "performance-now": "^2.1.0", - "qs": "~6.10.3", - "safe-buffer": "^5.1.2", - "tough-cookie": "^4.1.3", - "tunnel-agent": "^0.6.0", - "uuid": "^8.3.2" - }, - "dependencies": { - "qs": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", - "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", - "optional": true, - "requires": { - "side-channel": "^1.0.4" - } - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "optional": true - } - } - }, - "@cypress/xvfb": { - "version": "1.2.4", - "optional": true, - "requires": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "optional": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "@dependents/detective-less": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.1.0.tgz", - "integrity": "sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==", - "dev": true, - "requires": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - } - }, "@dessert-box/core": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@dessert-box/core/-/core-0.2.0.tgz", @@ -32779,14 +31133,6 @@ "@types/pollyjs__core": "*" } }, - "@types/sinonjs__fake-timers": { - "version": "8.1.1", - "optional": true - }, - "@types/sizzle": { - "version": "2.3.3", - "optional": true - }, "@types/stack-utils": { "version": "2.0.1", "optional": true @@ -32845,13 +31191,6 @@ "version": "20.2.0", "devOptional": true }, - "@types/yauzl": { - "version": "2.10.0", - "optional": true, - "requires": { - "@types/node": "*" - } - }, "@types/zen-observable": { "version": "0.8.3" }, @@ -33396,16 +31735,6 @@ "extract-files": "^11.0.0" } }, - "app-module-path": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", - "integrity": "sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==", - "dev": true - }, - "arch": { - "version": "2.2.0", - "optional": true - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -33529,15 +31858,6 @@ "version": "2.0.6", "dev": true }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "optional": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, "asn1js": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", @@ -33549,18 +31869,6 @@ "tslib": "^2.4.0" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "optional": true - }, - "ast-module-types": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", - "integrity": "sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==", - "dev": true - }, "astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -33569,16 +31877,12 @@ }, "async": { "version": "3.2.3", - "devOptional": true + "dev": true }, "asynckit": { "version": "0.4.0", "devOptional": true }, - "at-least-node": { - "version": "1.0.0", - "optional": true - }, "attr-accept": { "version": "2.2.2" }, @@ -33590,18 +31894,6 @@ "version": "1.0.5", "optional": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "optional": true - }, - "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "optional": true - }, "axios": { "version": "0.21.4", "dev": true, @@ -33748,16 +32040,7 @@ }, "base64-js": { "version": "1.5.1", - "devOptional": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } + "dev": true }, "better-path-resolve": { "version": "1.0.0", @@ -33798,13 +32081,9 @@ } } }, - "blob-util": { - "version": "2.0.2", - "optional": true - }, "bluebird": { "version": "3.7.2", - "devOptional": true + "dev": true }, "boolbase": { "version": "1.0.0", @@ -33868,10 +32147,6 @@ "node-int64": "^0.4.0" } }, - "buffer-crc32": { - "version": "0.2.13", - "optional": true - }, "buffer-from": { "version": "1.1.1", "devOptional": true @@ -33889,10 +32164,6 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true }, - "cachedir": { - "version": "2.3.0", - "optional": true - }, "call-bind": { "version": "1.0.2", "requires": { @@ -33952,12 +32223,6 @@ } } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "optional": true - }, "ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -34067,7 +32332,7 @@ }, "check-more-types": { "version": "2.24.0", - "devOptional": true + "dev": true }, "chokidar": { "version": "3.5.3", @@ -34128,16 +32393,6 @@ "version": "2.6.0", "dev": true }, - "cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", - "optional": true, - "requires": { - "@colors/colors": "1.5.0", - "string-width": "^4.2.0" - } - }, "cli-truncate": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", @@ -34365,7 +32620,7 @@ "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "devOptional": true + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -34382,7 +32637,7 @@ }, "common-tags": { "version": "1.8.0", - "devOptional": true + "dev": true }, "compute-scroll-into-view": { "version": "1.0.17" @@ -34399,15 +32654,6 @@ "version": "2.15.3", "dev": true }, - "console.table": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", - "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", - "dev": true, - "requires": { - "easy-table": "1.1.0" - } - }, "constant-case": { "version": "3.0.4", "dev": true, @@ -34448,10 +32694,6 @@ "version": "3.10.1", "dev": true }, - "core-util-is": { - "version": "1.0.2", - "optional": true - }, "cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -34644,283 +32886,6 @@ "array-find-index": "^1.0.1" } }, - "cypress": { - "version": "12.17.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.0.tgz", - "integrity": "sha512-nq0ug8Zrjq/2khHU1PTNxg+3/n1oqtmAFCxwQhS6QzkQ4mR6RLitX+cGIOuIMfnEbDAtVub0hZh661FOA16JxA==", - "optional": true, - "requires": { - "@cypress/request": "^2.88.10", - "@cypress/xvfb": "^1.2.4", - "@types/node": "^14.14.31", - "@types/sinonjs__fake-timers": "8.1.1", - "@types/sizzle": "^2.3.2", - "arch": "^2.2.0", - "blob-util": "^2.0.2", - "bluebird": "^3.7.2", - "buffer": "^5.6.0", - "cachedir": "^2.3.0", - "chalk": "^4.1.0", - "check-more-types": "^2.24.0", - "cli-cursor": "^3.1.0", - "cli-table3": "~0.6.1", - "commander": "^6.2.1", - "common-tags": "^1.8.0", - "dayjs": "^1.10.4", - "debug": "^4.3.4", - "enquirer": "^2.3.6", - "eventemitter2": "6.4.7", - "execa": "4.1.0", - "executable": "^4.1.1", - "extract-zip": "2.0.1", - "figures": "^3.2.0", - "fs-extra": "^9.1.0", - "getos": "^3.2.1", - "is-ci": "^3.0.0", - "is-installed-globally": "~0.4.0", - "lazy-ass": "^1.6.0", - "listr2": "^3.8.3", - "lodash": "^4.17.21", - "log-symbols": "^4.0.0", - "minimist": "^1.2.8", - "ospath": "^1.2.2", - "pretty-bytes": "^5.6.0", - "proxy-from-env": "1.0.0", - "request-progress": "^3.0.0", - "semver": "^7.5.3", - "supports-color": "^8.1.1", - "tmp": "~0.2.1", - "untildify": "^4.0.0", - "yauzl": "^2.10.0" - }, - "dependencies": { - "@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", - "optional": true - }, - "buffer": { - "version": "5.7.1", - "optional": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "chalk": { - "version": "4.1.2", - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "supports-color": { - "version": "7.2.0", - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "optional": true - }, - "fs-extra": { - "version": "9.1.0", - "optional": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "optional": true - }, - "jsonfile": { - "version": "6.1.0", - "optional": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "listr2": { - "version": "3.14.0", - "optional": true, - "requires": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", - "rfdc": "^1.3.0", - "rxjs": "^7.5.1", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" - } - }, - "p-map": { - "version": "4.0.0", - "optional": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "proxy-from-env": { - "version": "1.0.0", - "optional": true - }, - "rxjs": { - "version": "7.5.5", - "optional": true, - "requires": { - "tslib": "^2.1.0" - } - }, - "supports-color": { - "version": "8.1.1", - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "tmp": { - "version": "0.2.1", - "optional": true, - "requires": { - "rimraf": "^3.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "optional": true - } - } - }, - "cypress-file-upload": { - "version": "5.0.8", - "optional": true - }, - "cypress-mailhog": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/cypress-mailhog/-/cypress-mailhog-1.7.0.tgz", - "integrity": "sha512-OBk27OYm4slL5lCtphlHTlFPnrDEmuMeqSTch4/uk92iPzh8+gS4Y1KAmMiZsSDGjQzXi/7Ab5QWo6xmq8evXg==", - "optional": true - }, - "cypress-mochawesome-reporter": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.5.1.tgz", - "integrity": "sha512-/5ahFTyTxLujdzfTvmQrzKrJ8GWv12rUbOHvzWfVRYlAp/088ffU/1QbcfacEa2HTs28onSIIBiIKqSOID/bTw==", - "optional": true, - "requires": { - "fs-extra": "^10.0.1", - "mochawesome": "^7.1.3", - "mochawesome-merge": "^4.2.1", - "mochawesome-report-generator": "^6.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "optional": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "optional": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "optional": true - } - } - }, - "cypress-multi-reporters": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/cypress-multi-reporters/-/cypress-multi-reporters-1.6.3.tgz", - "integrity": "sha512-klb9pf6oAF4WCLHotu9gdB8ukYBdeTzbEMuESKB3KT54HhrZj65vQxubAgrULV5H2NWqxHdUhlntPbKZChNvEw==", - "dev": true, - "requires": { - "debug": "^4.3.4", - "lodash": "^4.17.21" - } - }, - "cypress-recurse": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/cypress-recurse/-/cypress-recurse-1.27.0.tgz", - "integrity": "sha512-BCD83UqaxlD+JiqZn1PvIhHRXasgfCt57vLC1Fcyifvxh4QklELRcYUJV3MdhKamMkmajaErLfnCNbZ8VJ5SIg==", - "dev": true, - "requires": { - "humanize-duration": "^3.27.3" - } - }, - "cypress-repeat": { - "version": "2.3.3", - "optional": true, - "requires": { - "arg": "5.0.2", - "bluebird": "3.7.2", - "debug": "4.3.4", - "dotenv": "8.2.0" - }, - "dependencies": { - "arg": { - "version": "5.0.2", - "optional": true - }, - "dotenv": { - "version": "8.2.0", - "optional": true - } - } - }, - "cypress-split": { - "version": "1.3.15", - "resolved": "https://registry.npmjs.org/cypress-split/-/cypress-split-1.3.15.tgz", - "integrity": "sha512-5YZtBzNX72OZDE6Kl6cqKMpeMmPRJIl8EOZXBv8METW1wyaOJJwYxHXYEObZ85IILmXyfkH0HtDWDLM8Ez/Snw==", - "dev": true, - "requires": { - "@actions/core": "^1.10.0", - "console.table": "^0.10.0", - "debug": "^4.3.4", - "find-cypress-specs": "1.35.1", - "humanize-duration": "^3.28.0" - } - }, - "cypress-timings": { - "version": "1.0.0", - "optional": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "data-urls": { "version": "2.0.0", "optional": true, @@ -34938,11 +32903,7 @@ }, "dateformat": { "version": "4.6.3", - "devOptional": true - }, - "dayjs": { - "version": "1.11.2", - "optional": true + "dev": true }, "debounce": { "version": "1.2.1", @@ -34958,7 +32919,7 @@ }, "decamelize": { "version": "1.2.0", - "devOptional": true + "dev": true }, "decamelize-keys": { "version": "1.1.1", @@ -35206,26 +33167,6 @@ "version": "0.11.0", "dev": true }, - "dependency-tree": { - "version": "10.0.9", - "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-10.0.9.tgz", - "integrity": "sha512-dwc59FRIsht+HfnTVM0BCjJaEWxdq2YAvEDy4/Hn6CwS3CBWMtFnL3aZGAkQn3XCYxk/YcTDE4jX2Q7bFTwCjA==", - "dev": true, - "requires": { - "commander": "^10.0.1", - "filing-cabinet": "^4.1.6", - "precinct": "^11.0.5", - "typescript": "^5.0.4" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - } - } - }, "dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -35244,86 +33185,6 @@ "detect-node-es": { "version": "1.1.0" }, - "detective-amd": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.2.tgz", - "integrity": "sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==", - "dev": true, - "requires": { - "ast-module-types": "^5.0.0", - "escodegen": "^2.0.0", - "get-amd-module-type": "^5.0.1", - "node-source-walk": "^6.0.1" - } - }, - "detective-cjs": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-5.0.1.tgz", - "integrity": "sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==", - "dev": true, - "requires": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.0" - } - }, - "detective-es6": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-4.0.1.tgz", - "integrity": "sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==", - "dev": true, - "requires": { - "node-source-walk": "^6.0.1" - } - }, - "detective-postcss": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", - "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", - "dev": true, - "requires": { - "is-url": "^1.2.4", - "postcss": "^8.4.23", - "postcss-values-parser": "^6.0.2" - } - }, - "detective-sass": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-5.0.3.tgz", - "integrity": "sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==", - "dev": true, - "requires": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - } - }, - "detective-scss": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-4.0.3.tgz", - "integrity": "sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==", - "dev": true, - "requires": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - } - }, - "detective-stylus": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-4.0.0.tgz", - "integrity": "sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==", - "dev": true - }, - "detective-typescript": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.1.0.tgz", - "integrity": "sha512-Mq8egjnW2NSCkzEb/Az15/JnBI/Ryyl6Po0Y+0mABTFvOS6DAyUGRZqz1nyhu4QJmWWe0zaGs/ITIBeWkvCkGw==", - "dev": true, - "requires": { - "@typescript-eslint/typescript-estree": "^5.59.5", - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1", - "typescript": "^5.0.4" - } - }, "diff": { "version": "4.0.2", "dev": true @@ -35474,25 +33335,6 @@ "version": "0.1.2", "dev": true }, - "easy-table": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", - "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", - "dev": true, - "requires": { - "wcwidth": ">=1.0.1" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "editorjs-inline-tool": { "version": "0.4.0" }, @@ -35529,16 +33371,6 @@ "once": "^1.4.0" } }, - "enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, "enquirer": { "version": "2.3.6", "devOptional": true, @@ -35959,7 +33791,7 @@ }, "escape-html": { "version": "1.0.3", - "devOptional": true + "dev": true }, "escape-string-regexp": { "version": "1.0.5" @@ -35968,7 +33800,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "devOptional": true, + "optional": true, "requires": { "esprima": "^4.0.1", "estraverse": "^5.2.0", @@ -36795,10 +34627,6 @@ "through": "~2.3.1" } }, - "eventemitter2": { - "version": "6.4.7", - "optional": true - }, "execa": { "version": "4.1.0", "devOptional": true, @@ -36814,19 +34642,6 @@ "strip-final-newline": "^2.0.0" } }, - "executable": { - "version": "4.1.1", - "optional": true, - "requires": { - "pify": "^2.2.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "optional": true - } - } - }, "exenv": { "version": "1.2.2" }, @@ -36865,22 +34680,6 @@ "extract-files": { "version": "11.0.0" }, - "extract-zip": { - "version": "2.0.1", - "optional": true, - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "optional": true - }, "faker": { "version": "5.5.2" }, @@ -36985,13 +34784,6 @@ "version": "1.0.2", "dev": true }, - "fd-slicer": { - "version": "1.1.0", - "optional": true, - "requires": { - "pend": "~1.2.0" - } - }, "fflate": { "version": "0.4.8", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", @@ -37046,85 +34838,12 @@ } } }, - "filing-cabinet": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-4.1.6.tgz", - "integrity": "sha512-C+HZbuQTER36sKzGtUhrAPAoK6+/PrrUhYDBQEh3kBRdsyEhkLbp1ML8S0+6e6gCUrUlid+XmubxJrhvL2g/Zw==", - "dev": true, - "requires": { - "app-module-path": "^2.2.0", - "commander": "^10.0.1", - "enhanced-resolve": "^5.14.1", - "is-relative-path": "^1.0.2", - "module-definition": "^5.0.1", - "module-lookup-amd": "^8.0.5", - "resolve": "1.20.0", - "resolve-dependency-path": "^3.0.2", - "sass-lookup": "^5.0.1", - "stylus-lookup": "^5.0.1", - "tsconfig-paths": "^4.2.0", - "typescript": "^5.0.4" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - }, - "tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", - "dev": true, - "requires": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - } - } - }, "fill-range": { "version": "7.0.1", "requires": { "to-regex-range": "^5.0.1" } }, - "find-cypress-specs": { - "version": "1.35.1", - "resolved": "https://registry.npmjs.org/find-cypress-specs/-/find-cypress-specs-1.35.1.tgz", - "integrity": "sha512-ngLPf/U/I8jAS6vn5ljClETa6seG+fmr3oXw6BcYX3xVIk7D8jNljHUIJCTDvnK90XOI1cflYGuNFDezhRBNvQ==", - "dev": true, - "requires": { - "@actions/core": "^1.10.0", - "arg": "^5.0.1", - "console.table": "^0.10.0", - "debug": "^4.3.3", - "find-test-names": "1.28.13", - "globby": "^11.1.0", - "minimatch": "^3.0.4", - "pluralize": "^8.0.0", - "require-and-forget": "^1.0.1", - "shelljs": "^0.8.5", - "spec-change": "^1.7.1", - "ts-node": "^10.9.1" - }, - "dependencies": { - "arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true - } - } - }, "find-root": { "version": "1.1.0" }, @@ -37241,23 +34960,6 @@ "is-callable": "^1.1.3" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "optional": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "from": { "version": "0.1.7", "dev": true @@ -37296,7 +34998,7 @@ }, "fsu": { "version": "1.1.1", - "devOptional": true + "dev": true }, "function-bind": { "version": "1.1.1" @@ -37321,16 +35023,6 @@ "gensync": { "version": "1.0.0-beta.2" }, - "get-amd-module-type": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-5.0.1.tgz", - "integrity": "sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==", - "dev": true, - "requires": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - } - }, "get-caller-file": { "version": "2.0.5", "devOptional": true @@ -37348,7 +35040,7 @@ }, "get-own-enumerable-property-symbols": { "version": "3.0.2", - "devOptional": true + "optional": true }, "get-package-type": { "version": "0.1.0", @@ -37369,22 +35061,6 @@ "get-intrinsic": "^1.1.1" } }, - "getos": { - "version": "3.2.1", - "optional": true, - "requires": { - "async": "^3.2.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "github-buttons": { "version": "2.22.1" }, @@ -37408,14 +35084,14 @@ }, "global-dirs": { "version": "3.0.0", - "devOptional": true, + "dev": true, "requires": { "ini": "2.0.0" }, "dependencies": { "ini": { "version": "2.0.0", - "devOptional": true + "dev": true } } }, @@ -37435,15 +35111,6 @@ "slash": "^3.0.0" } }, - "gonzales-pe": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", - "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "graceful-fs": { "version": "4.2.10", "devOptional": true @@ -37789,17 +35456,6 @@ "debug": "4" } }, - "http-signature": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", - "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^2.0.2", - "sshpk": "^1.14.1" - } - }, "https-proxy-agent": { "version": "5.0.0", "requires": { @@ -37817,12 +35473,6 @@ "version": "1.1.1", "devOptional": true }, - "humanize-duration": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.28.0.tgz", - "integrity": "sha512-jMAxraOOmHuPbffLVDKkEKi/NeG8dMqP8lGRd6Tbf7JgAeG33jjgPWDbXXU7ypCI0o+oNKJFgbSB9FKVdWNI2A==", - "dev": true - }, "husky": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", @@ -37848,7 +35498,7 @@ }, "ieee754": { "version": "1.2.1", - "devOptional": true + "dev": true }, "ignore": { "version": "5.2.4", @@ -38034,10 +35684,6 @@ "side-channel": "^1.0.4" } }, - "interpret": { - "version": "1.4.0", - "dev": true - }, "intl-messageformat": { "version": "9.12.0", "requires": { @@ -38092,7 +35738,7 @@ }, "is-ci": { "version": "3.0.1", - "devOptional": true, + "dev": true, "requires": { "ci-info": "^3.2.0" } @@ -38133,7 +35779,7 @@ }, "is-installed-globally": { "version": "0.4.0", - "devOptional": true, + "dev": true, "requires": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -38167,11 +35813,11 @@ }, "is-obj": { "version": "1.0.1", - "devOptional": true + "optional": true }, "is-path-inside": { "version": "3.0.3", - "devOptional": true + "dev": true }, "is-plain-obj": { "version": "1.1.0", @@ -38197,7 +35843,7 @@ }, "is-regexp": { "version": "1.0.0", - "devOptional": true + "optional": true }, "is-relative": { "version": "1.0.0", @@ -38206,12 +35852,6 @@ "is-unc-path": "^1.0.0" } }, - "is-relative-path": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-relative-path/-/is-relative-path-1.0.2.tgz", - "integrity": "sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA==", - "dev": true - }, "is-set": { "version": "2.0.2", "optional": true @@ -38286,12 +35926,6 @@ "is-url": { "version": "1.2.4" }, - "is-url-superb": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", - "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", - "dev": true - }, "is-weakmap": { "version": "2.0.1", "optional": true @@ -38330,12 +35964,6 @@ "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "optional": true - }, "istanbul-lib-coverage": { "version": "3.2.0", "optional": true @@ -39294,12 +36922,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "optional": true - }, "jsdom": { "version": "16.7.0", "optional": true, @@ -39358,10 +36980,6 @@ "json-parse-even-better-errors": { "version": "2.3.1" }, - "json-schema": { - "version": "0.4.0", - "optional": true - }, "json-schema-traverse": { "version": "0.4.1", "dev": true @@ -39379,7 +36997,7 @@ }, "json-stringify-safe": { "version": "5.0.1", - "devOptional": true + "dev": true }, "json-to-pretty-yaml": { "version": "1.2.2", @@ -39402,7 +37020,7 @@ }, "jsonfile": { "version": "4.0.0", - "devOptional": true, + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -39411,18 +37029,6 @@ "version": "0.0.0", "dev": true }, - "jsprim": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", - "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, "jss": { "version": "9.8.7", "requires": { @@ -39784,7 +37390,7 @@ }, "lazy-ass": { "version": "1.6.0", - "devOptional": true + "dev": true }, "leven": { "version": "3.1.0", @@ -39927,19 +37533,19 @@ }, "lodash.isempty": { "version": "4.4.0", - "devOptional": true + "dev": true }, "lodash.isfunction": { "version": "3.0.9", - "devOptional": true + "dev": true }, "lodash.isobject": { "version": "3.0.2", - "devOptional": true + "dev": true }, "lodash.isstring": { "version": "4.0.1", - "devOptional": true + "dev": true }, "lodash.memoize": { "version": "4.1.2", @@ -39949,10 +37555,6 @@ "version": "4.6.2", "dev": true }, - "lodash.once": { - "version": "4.1.1", - "optional": true - }, "lodash.startcase": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", @@ -40954,7 +38556,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/mochawesome/-/mochawesome-7.1.3.tgz", "integrity": "sha512-Vkb3jR5GZ1cXohMQQ73H3cZz7RoxGjjUo0G5hu0jLaW+0FdUxUwg3Cj29bqQdh0rFcnyV06pWmqmi5eBPnEuNQ==", - "devOptional": true, + "dev": true, "requires": { "chalk": "^4.1.2", "diff": "^5.0.0", @@ -40972,7 +38574,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -40980,19 +38582,19 @@ }, "diff": { "version": "5.0.0", - "devOptional": true + "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true + "dev": true }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -41001,14 +38603,14 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "requires": { "has-flag": "^4.0.0" } }, "uuid": { "version": "8.3.2", - "devOptional": true + "dev": true } } }, @@ -41016,7 +38618,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/mochawesome-merge/-/mochawesome-merge-4.3.0.tgz", "integrity": "sha512-1roR6g+VUlfdaRmL8dCiVpKiaUhbPVm1ZQYUM6zHX46mWk+tpsKVZR6ba98k2zc8nlPvYd71yn5gyH970pKBSw==", - "devOptional": true, + "dev": true, "requires": { "fs-extra": "^7.0.1", "glob": "^7.1.6", @@ -41025,7 +38627,7 @@ "dependencies": { "cliui": { "version": "6.0.0", - "devOptional": true, + "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -41034,7 +38636,7 @@ }, "find-up": { "version": "4.1.0", - "devOptional": true, + "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -41042,7 +38644,7 @@ }, "fs-extra": { "version": "7.0.1", - "devOptional": true, + "dev": true, "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -41051,32 +38653,32 @@ }, "locate-path": { "version": "5.0.0", - "devOptional": true, + "dev": true, "requires": { "p-locate": "^4.1.0" } }, "p-locate": { "version": "4.1.0", - "devOptional": true, + "dev": true, "requires": { "p-limit": "^2.2.0" } }, "path-exists": { "version": "4.0.0", - "devOptional": true + "dev": true }, "strip-ansi": { "version": "6.0.1", - "devOptional": true, + "dev": true, "requires": { "ansi-regex": "^5.0.1" } }, "wrap-ansi": { "version": "6.2.0", - "devOptional": true, + "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -41085,7 +38687,7 @@ }, "yargs": { "version": "15.4.1", - "devOptional": true, + "dev": true, "requires": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -41102,7 +38704,7 @@ }, "yargs-parser": { "version": "18.1.3", - "devOptional": true, + "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -41114,7 +38716,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/mochawesome-report-generator/-/mochawesome-report-generator-6.2.0.tgz", "integrity": "sha512-Ghw8JhQFizF0Vjbtp9B0i//+BOkV5OWcQCPpbO0NGOoxV33o+gKDYU0Pr2pGxkIHnqZ+g5mYiXF7GMNgAcDpSg==", - "devOptional": true, + "dev": true, "requires": { "chalk": "^4.1.2", "dateformat": "^4.5.1", @@ -41132,7 +38734,7 @@ "dependencies": { "chalk": { "version": "4.1.2", - "devOptional": true, + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -41140,7 +38742,7 @@ }, "fs-extra": { "version": "10.0.1", - "devOptional": true, + "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -41149,11 +38751,11 @@ }, "has-flag": { "version": "4.0.0", - "devOptional": true + "dev": true }, "jsonfile": { "version": "6.1.0", - "devOptional": true, + "dev": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" @@ -41161,22 +38763,22 @@ }, "supports-color": { "version": "7.2.0", - "devOptional": true, + "dev": true, "requires": { "has-flag": "^4.0.0" } }, "universalify": { "version": "2.0.0", - "devOptional": true + "dev": true }, "y18n": { "version": "5.0.8", - "devOptional": true + "dev": true }, "yargs": { "version": "17.3.1", - "devOptional": true, + "dev": true, "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -41189,36 +38791,6 @@ }, "yargs-parser": { "version": "21.0.1", - "devOptional": true - } - } - }, - "module-definition": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-5.0.1.tgz", - "integrity": "sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==", - "dev": true, - "requires": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - } - }, - "module-lookup-amd": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-8.0.5.tgz", - "integrity": "sha512-vc3rYLjDo5Frjox8NZpiyLXsNWJ5BWshztc/5KSOMzpg9k5cHH652YsJ7VKKmtM4SvaxuE9RkrYGhiSjH3Ehow==", - "dev": true, - "requires": { - "commander": "^10.0.1", - "glob": "^7.2.3", - "requirejs": "^2.3.6", - "requirejs-config-file": "^4.0.0" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true } } @@ -41355,15 +38927,6 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, - "node-source-walk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.2.tgz", - "integrity": "sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==", - "dev": true, - "requires": { - "@babel/parser": "^7.21.8" - } - }, "normalize-package-data": { "version": "2.5.0", "dev": true, @@ -41489,7 +39052,7 @@ }, "opener": { "version": "1.5.2", - "devOptional": true + "dev": true }, "optimism": { "version": "0.16.1", @@ -41560,10 +39123,6 @@ "version": "1.0.2", "dev": true }, - "ospath": { - "version": "1.2.2", - "optional": true - }, "outdent": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", @@ -41715,14 +39274,6 @@ "through": "~2.3" } }, - "pend": { - "version": "1.2.0", - "optional": true - }, - "performance-now": { - "version": "2.1.0", - "optional": true - }, "picocolors": { "version": "1.0.0" }, @@ -41836,17 +39387,6 @@ "source-map-js": "^1.0.2" } }, - "postcss-values-parser": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", - "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", - "dev": true, - "requires": { - "color-name": "^1.1.4", - "is-url-superb": "^4.0.0", - "quote-unquote": "^1.0.0" - } - }, "posthog-js": { "version": "1.105.9", "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.105.9.tgz", @@ -41861,34 +39401,6 @@ "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.4.tgz", "integrity": "sha512-dwaX5jAh0Ga8uENBX1hSOujmKWgx9RtL80KaKUFLc6jb4vCEAc3EeZ0rnQO/FO4VgjfPMfoLFWnNG8bHuZ9VLw==" }, - "precinct": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.5.tgz", - "integrity": "sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==", - "dev": true, - "requires": { - "@dependents/detective-less": "^4.1.0", - "commander": "^10.0.1", - "detective-amd": "^5.0.2", - "detective-cjs": "^5.0.1", - "detective-es6": "^4.0.1", - "detective-postcss": "^6.1.3", - "detective-sass": "^5.0.3", - "detective-scss": "^4.0.3", - "detective-stylus": "^4.0.0", - "detective-typescript": "^11.1.0", - "module-definition": "^5.0.1", - "node-source-walk": "^6.0.2" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - } - } - }, "preferred-pm": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz", @@ -41960,10 +39472,6 @@ "fast-diff": "^1.1.2" } }, - "pretty-bytes": { - "version": "5.6.0", - "optional": true - }, "pretty-format": { "version": "27.5.1", "optional": true, @@ -42149,12 +39657,6 @@ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, - "quote-unquote": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", - "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", - "dev": true - }, "randombytes": { "version": "2.1.0", "dev": true, @@ -42585,13 +40087,6 @@ "picomatch": "^2.2.1" } }, - "rechoir": { - "version": "0.6.2", - "dev": true, - "requires": { - "resolve": "1.20.0" - } - }, "redent": { "version": "3.0.0", "devOptional": true, @@ -42777,22 +40272,6 @@ "version": "1.0.8", "dev": true }, - "request-progress": { - "version": "3.0.0", - "optional": true, - "requires": { - "throttleit": "^1.0.0" - } - }, - "require-and-forget": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-and-forget/-/require-and-forget-1.0.1.tgz", - "integrity": "sha512-Sea861D/seGo3cptxc857a34Df0oEijXit8Q3IDodiwZMzVmyXrRI9EgQQa3hjkhoEjNzCBvv0t/0fMgebmWLg==", - "dev": true, - "requires": { - "debug": "4.3.4" - } - }, "require-context.macro": { "version": "1.2.2", "dev": true, @@ -42810,24 +40289,8 @@ }, "require-main-filename": { "version": "2.0.0", - "devOptional": true - }, - "requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", "dev": true }, - "requirejs-config-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", - "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", - "dev": true, - "requires": { - "esprima": "^4.0.0", - "stringify-object": "^3.2.1" - } - }, "requires-port": { "version": "1.0.0", "optional": true @@ -42846,12 +40309,6 @@ "resolve-from": "^5.0.0" } }, - "resolve-dependency-path": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/resolve-dependency-path/-/resolve-dependency-path-3.0.2.tgz", - "integrity": "sha512-Tz7zfjhLfsvR39ADOSk9us4421J/1ztVBo4rWUkF38hgHK5m0OCZ3NxFVpqHRkjctnwVa15igEUHFJp8MCS7vA==", - "dev": true - }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -42894,7 +40351,7 @@ }, "rfdc": { "version": "1.3.0", - "devOptional": true + "dev": true }, "rimraf": { "version": "3.0.2", @@ -42966,7 +40423,7 @@ }, "safe-buffer": { "version": "5.2.1", - "devOptional": true + "dev": true }, "safe-regex-test": { "version": "1.0.0", @@ -42981,23 +40438,6 @@ "version": "2.1.2", "devOptional": true }, - "sass-lookup": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/sass-lookup/-/sass-lookup-5.0.1.tgz", - "integrity": "sha512-t0X5PaizPc2H4+rCwszAqHZRtr4bugo4pgiCvrBFvIX0XFxnr29g77LJcpyj9A0DcKf7gXMLcgvRjsonYI6x4g==", - "dev": true, - "requires": { - "commander": "^10.0.1" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - } - } - }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -43060,7 +40500,7 @@ }, "set-blocking": { "version": "2.0.0", - "devOptional": true + "dev": true }, "setimmediate": { "version": "1.0.5", @@ -43096,17 +40536,6 @@ "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", "dev": true }, - "shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, "side-channel": { "version": "1.0.4", "requires": { @@ -43361,33 +40790,6 @@ "version": "3.0.7", "dev": true }, - "spec-change": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/spec-change/-/spec-change-1.7.1.tgz", - "integrity": "sha512-bZmtSmS5w6M6Snae+AGp+y89MZ7QG2SZW1v3Au83+YWcZzCu0YtH2hXruJWXg6VdYUpQ3n+m9bRrWmwLaPkFjQ==", - "dev": true, - "requires": { - "arg": "^5.0.2", - "debug": "^4.3.4", - "dependency-tree": "^10.0.9", - "globby": "^11.1.0", - "lazy-ass": "^2.0.3" - }, - "dependencies": { - "arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "lazy-ass": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-2.0.3.tgz", - "integrity": "sha512-/O3/DoQmI1XAhklDvF1dAjFf/epE8u3lzOZegQfLZ8G7Ud5bTRSZiFOpukHCu6jODrCA4gtIdwUCC7htxcDACA==", - "dev": true - } - } - }, "split": { "version": "0.3.3", "dev": true, @@ -43405,23 +40807,6 @@ "sprintf-js": { "version": "1.0.3" }, - "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "stack-utils": { "version": "2.0.6", "optional": true, @@ -43608,7 +40993,7 @@ }, "stringify-object": { "version": "3.3.0", - "devOptional": true, + "optional": true, "requires": { "get-own-enumerable-property-symbols": "^3.0.0", "is-obj": "^1.0.1", @@ -43664,23 +41049,6 @@ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz", "integrity": "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" }, - "stylus-lookup": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stylus-lookup/-/stylus-lookup-5.0.1.tgz", - "integrity": "sha512-tLtJEd5AGvnVy4f9UHQMw4bkJJtaAcmo54N+ovQBjDY3DuWyK9Eltxzr5+KG0q4ew6v2EHyuWWNnHeiw/Eo7rQ==", - "dev": true, - "requires": { - "commander": "^10.0.1" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - } - } - }, "supports-color": { "version": "5.5.0", "requires": { @@ -43749,11 +41117,11 @@ }, "tcomb": { "version": "3.2.29", - "devOptional": true + "dev": true }, "tcomb-validation": { "version": "3.4.1", - "devOptional": true, + "dev": true, "requires": { "tcomb": "^3.0.0" } @@ -43856,10 +41224,6 @@ "throttle-debounce": { "version": "2.3.0" }, - "throttleit": { - "version": "1.0.0", - "optional": true - }, "through": { "version": "2.3.8", "devOptional": true @@ -44142,27 +41506,6 @@ } } }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "optional": true - }, "type-detect": { "version": "4.0.8", "optional": true @@ -44333,7 +41676,7 @@ }, "universalify": { "version": "0.1.2", - "devOptional": true + "dev": true }, "unixify": { "version": "1.0.0", @@ -44359,10 +41702,6 @@ "version": "1.0.0", "dev": true }, - "untildify": { - "version": "4.0.0", - "optional": true - }, "update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", @@ -44509,7 +41848,7 @@ }, "validator": { "version": "13.7.0", - "devOptional": true + "dev": true }, "value-equal": { "version": "1.0.1" @@ -44520,17 +41859,6 @@ "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", "dev": true }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vfile": { "version": "5.3.7", "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", @@ -44921,7 +42249,7 @@ }, "which-module": { "version": "2.0.0", - "devOptional": true + "dev": true }, "which-pm": { "version": "2.0.0", @@ -45039,7 +42367,7 @@ }, "y18n": { "version": "4.0.3", - "devOptional": true + "dev": true }, "yallist": { "version": "4.0.0", @@ -45115,14 +42443,6 @@ } } }, - "yauzl": { - "version": "2.10.0", - "optional": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index b6229446f54..32e3bad863b 100644 --- a/package.json +++ b/package.json @@ -152,9 +152,6 @@ "codecov": "^3.7.1", "core-js": "^3.7.0", "cross-env": "^6.0.3", - "cypress-multi-reporters": "^1.6.3", - "cypress-recurse": "^1.27.0", - "cypress-split": "^1.3.15", "dependency-cruiser": "^12.10.0", "dotenv": "^10.0.0", "env-var": "^7.3.0", @@ -206,13 +203,6 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^26.0.14", "@types/setup-polly-jest": "^0.5.0", - "cypress": "^12.17.0", - "cypress-file-upload": "^5.0.8", - "cypress-mailhog": "^1.3.0", - "cypress-mochawesome-reporter": "^3.5.1", - "cypress-multi-reporters": "^1.5.0", - "cypress-repeat": "^2.3.3", - "cypress-timings": "^1.0.0", "fsevents": "^1.2.9", "husky": "^8.0.3", "jest": "^27.5.1", @@ -293,14 +283,6 @@ "heroku-postbuild": "npm run build", "serve:lhci": "cross-env NODE_ENV=production npm run server", "prestart": "npm run build-types", - "cy:run": "cypress run", - "cy:run:dashboard": "cypress run --record", - "cy:open": "cypress open", - "cy:run:critical": "cypress run --record --env grepTags=@critical", - "cy:run:allEnv": "cypress run --record --env grepTags=@allEnv", - "cy:run:critical:parallel": "cypress run --record --env grepTags=@critical --parallel --tag Critical", - "cy:run:allEnv:parallel": "cypress run --record --env grepTags=@allEnv --parallel", - "cy:run:stable:parallel": "cypress run --record --env grepTags=@critical --parallel --tag Stable", "test": "jest src/", "posttest": "node scripts/pika.js", "test:watch": "jest --watch src/", diff --git a/reporter-config.json b/reporter-config.json deleted file mode 100644 index 92767bcebc1..00000000000 --- a/reporter-config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "reporterEnabled": "mocha-junit-reporter, mochawesome", - - "mochaJunitReporterReporterOptions": { - "mochaFile": "cypress/reports/junit/results-[hash].xml" - }, - "reporterOptions": { - "reportDir": "cypress/reports/mocha", - "screenshotOnRunFailure": true, - "overwrite": false, - "quite": true, - "html": false, - "json": true - } -} diff --git a/tsconfig.json b/tsconfig.json index cdddaa28f62..b6e8845852f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,5 +23,5 @@ "@test/*": ["testUtils/*"] } }, - "exclude": ["node_modules", "cypress", "playwright"] + "exclude": ["node_modules", "playwright"] }