@vtex/faststore-plugin-buyer-portal 1.0.49 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +51 -0
- package/cypress/integration/home.test.ts +17 -0
- package/cypress.config.ts +17 -0
- package/package.json +2 -1
- package/src/features/buying-policies/utils/index.ts +1 -1
- package/src/features/shared/components/index.ts +2 -2
- package/src/features/users/services/index.ts +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI E2E Plugin
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [labeled]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
if: github.event.label.name == 'run-tests'
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout plugin repository
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
path: plugin
|
|
16
|
+
|
|
17
|
+
- name: Checkout b2bfaststoredev.store repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
repository: vtex-sites/b2bfaststoredev.store
|
|
21
|
+
path: b2bfaststoredev.store
|
|
22
|
+
token: ${{ secrets.B2BFASTSTOREDEV_STORE_TOKEN }}
|
|
23
|
+
|
|
24
|
+
- name: Set up Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 18
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies in plugin
|
|
30
|
+
run: yarn install
|
|
31
|
+
working-directory: ./plugin
|
|
32
|
+
|
|
33
|
+
- name: Yarn link plugin
|
|
34
|
+
run: |
|
|
35
|
+
yarn link
|
|
36
|
+
working-directory: ./plugin
|
|
37
|
+
|
|
38
|
+
- name: Yarn link plugin in b2bfaststoredev.store
|
|
39
|
+
run: |
|
|
40
|
+
yarn link "@vtex/faststore-plugin-buyer-portal"
|
|
41
|
+
working-directory: ./b2bfaststoredev.store
|
|
42
|
+
|
|
43
|
+
- name: Cypress run
|
|
44
|
+
uses: cypress-io/github-action@v6
|
|
45
|
+
with:
|
|
46
|
+
working-directory: ./b2bfaststoredev.store
|
|
47
|
+
build: yarn build
|
|
48
|
+
start: yarn start
|
|
49
|
+
config-file: ../plugin/cypress.config.ts
|
|
50
|
+
browser: chrome
|
|
51
|
+
env: VTEX_AUTH_TOKEN=${{secrets.VTEX_AUTH_TOKEN}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
describe("Home page", () => {
|
|
2
|
+
it("should load successfully", () => {
|
|
3
|
+
const authCookie = Cypress.env("VTEX_AUTH_TOKEN");
|
|
4
|
+
|
|
5
|
+
cy.setCookie("VtexIdclientAutCookie_b2bfaststoredev", authCookie);
|
|
6
|
+
|
|
7
|
+
// Visit the homepage
|
|
8
|
+
cy.visit("/buyer-portal");
|
|
9
|
+
|
|
10
|
+
// Wait for the text to be visible on the page with increased timeout
|
|
11
|
+
cy.contains("Champlin - Editado 3").should("be.visible");
|
|
12
|
+
|
|
13
|
+
// Check if the page loads without errors
|
|
14
|
+
cy.window().should("exist");
|
|
15
|
+
cy.document().should("exist");
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from "cypress";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
retries: 0,
|
|
5
|
+
video: true,
|
|
6
|
+
trashAssetsBeforeRuns: true,
|
|
7
|
+
screenshotOnRunFailure: true,
|
|
8
|
+
viewportWidth: 1000,
|
|
9
|
+
viewportHeight: 600,
|
|
10
|
+
e2e: {
|
|
11
|
+
supportFile: false,
|
|
12
|
+
specPattern:
|
|
13
|
+
"node_modules/@vtex/faststore-plugin-buyer-portal/cypress/integration/**/*.test.{js,jsx,ts,tsx}",
|
|
14
|
+
baseUrl: "http://localhost:3000/",
|
|
15
|
+
experimentalRunAllSpecs: true,
|
|
16
|
+
},
|
|
17
|
+
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtex/faststore-plugin-buyer-portal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A plugin for faststore with buyer portal",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@types/react-dom": "^19.0.3",
|
|
8
|
+
"cypress": "13",
|
|
8
9
|
"react-dom": "^19.0.0"
|
|
9
10
|
},
|
|
10
11
|
"devDependencies": {
|
|
@@ -3,5 +3,5 @@ export { orderFieldsCriteriaOptions } from "./orderFieldsCriteriaOptions";
|
|
|
3
3
|
export { spendingLimitsCriteriaOptions } from "./spendingLimitsCriteriaOptions";
|
|
4
4
|
export {
|
|
5
5
|
BUYING_POLICIES_WORKFLOW_TYPES,
|
|
6
|
-
BuyingPoliciesWorkflowType,
|
|
6
|
+
type BuyingPoliciesWorkflowType,
|
|
7
7
|
} from "./buyingPoliciesWorkflowTypes";
|
|
@@ -73,5 +73,5 @@ export {
|
|
|
73
73
|
} from "./LevelDivider/LevelDivider";
|
|
74
74
|
|
|
75
75
|
export { Paginator } from "./Paginator/Paginator";
|
|
76
|
-
export { CounterProps as PaginatorCounterProps } from "./Paginator/Counter";
|
|
77
|
-
export { NextPageButtonProps as PaginatorNextPageButtonProps } from "./Paginator/NextPageButton";
|
|
76
|
+
export type { CounterProps as PaginatorCounterProps } from "./Paginator/Counter";
|
|
77
|
+
export type { NextPageButtonProps as PaginatorNextPageButtonProps } from "./Paginator/NextPageButton";
|