Skip to content

Commit

Permalink
add cypress workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrc committed Dec 6, 2023
1 parent 8cf1874 commit a3b4b40
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 34 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Cypress

on:
push:
branches: [master]
pull_request:

jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install formule dependencies
run: yarn install --frozen-lockfile
- name: Link
run: yarn link-local && cd formule-demo && yarn link-local-lib
- name: Install formule-demo dependencies
working-directory: ./formule-demo
run: yarn install --frozen-lockfile
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: ./formule-demo
install: false
start: yarn dev
6 changes: 2 additions & 4 deletions formule-demo/cypress/e2e/builder.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe("test basic functionality", () => {
beforeEach(() => {
cy.visit("localhost:3000");
cy.visit("localhost:3030");
});

it("allows drag and drop to the SchemaTree", () => {
Expand Down Expand Up @@ -133,9 +133,7 @@ describe("test basic functionality", () => {
cy.get("input#root_ui\\:options_mask").clearTypeBlur("BA-00/a")
cy.get("@myfield").focus()
cy.get("@myfield").should("have.value", "B_-__/_")
cy.get("@myfield").clearTypeBlur("Xyz")
cy.get("@myfield").should("have.value", "BX-__/_")
cy.get("@myfield").clearTypeBlur("NWW5j34r")
cy.get("@myfield").type("NWW5j34r")
cy.get("@myfield").should("have.value", "BN-53/r")

// TODO test also suggestion endpoint, after that feature is migrated to formule
Expand Down
3 changes: 2 additions & 1 deletion formule-demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default defineConfig({
},
server: {
// Needed for cypress to be able to access the dev server
host: true
host: true,
port: 3030,
},
// Enables hmr in development without having to rebuild the library
resolve: {
Expand Down
53 changes: 24 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
classnames "^2.2.6"
rc-util "^5.31.1"

"@ant-design/[email protected]":
version "7.16.4"
resolved "https://registry.yarnpkg.com/@ant-design/pro-layout/-/pro-layout-7.16.4.tgz#1d0040eed59ac99d4d78bd6f7d90709881f581e2"
integrity sha512-A3iWPLUBl28Phe/Itu8dNoxT+Ci3+Zh04x5q7zeiEJdlFIRmIqotFBvANqFf1ndQovt+SqwkSFfi/GqH7EnN3w==
"@ant-design/pro-layout@^7.16.4":
version "7.17.16"
resolved "https://registry.yarnpkg.com/@ant-design/pro-layout/-/pro-layout-7.17.16.tgz#124d87d4b602994a395de34caf814304e2c4b72a"
integrity sha512-nBQbAJEUkGqQNBqT30FcbcNXHepxySj/O7est1+2iXPXeVeyQYLHBJXcdvCrUrMty6ev3loG8K+6L3DXQkJ/5Q==
dependencies:
"@ant-design/icons" "^5.0.0"
"@ant-design/pro-provider" "2.11.1"
"@ant-design/pro-utils" "2.12.6"
"@ant-design/pro-provider" "2.13.5"
"@ant-design/pro-utils" "2.15.2"
"@babel/runtime" "^7.18.0"
"@umijs/route-utils" "^4.0.0"
"@umijs/use-params" "^1.0.9"
Expand All @@ -61,32 +61,32 @@
rc-resize-observer "^1.1.0"
rc-util "^5.0.6"
swr "^2.0.0"
use-json-comparison "^1.0.3"
use-media-antd-query "^1.1.0"
warning "^4.0.3"

"@ant-design/pro-provider@2.11.1":
version "2.11.1"
resolved "https://registry.yarnpkg.com/@ant-design/pro-provider/-/pro-provider-2.11.1.tgz#063b1157766a571fd2c06a6db4f52a5590976ffd"
integrity sha512-A7zXZ+58IGVuIAGvo8Hia9Wz0TFfFMo+tIv16Pu2RF9sMdGg4pE5M87qT7+45TkKodWpnpBd4cIte3jfY5v/LQ==
"@ant-design/pro-provider@2.13.5":
version "2.13.5"
resolved "https://registry.yarnpkg.com/@ant-design/pro-provider/-/pro-provider-2.13.5.tgz#4f2a14ec21a014fc334e8a56741433ff06b02be6"
integrity sha512-ZVmzY2cq4nUvgmAlfgyCAaSZYV2l3n/upIQPXPj8sYcT+N/Pt1CeSVkkgW6By3EqokF6apWdIFU7hZMK2rNhrg==
dependencies:
"@ant-design/cssinjs" "^1.11.1"
"@babel/runtime" "^7.18.0"
"@ctrl/tinycolor" "^3.4.0"
rc-util "^5.0.1"
swr "^2.0.0"

"@ant-design/pro-utils@2.12.6":
version "2.12.6"
resolved "https://registry.yarnpkg.com/@ant-design/pro-utils/-/pro-utils-2.12.6.tgz#a2eac2a756d574614f9d8f3438788dbe922488d8"
integrity sha512-zBCD+uH0dZFM+ThRNDKHfLNCFfBa1vL/2KlPGGAOEIphx/Lt2PREELAHE6GnurlDEmNuBQFtAAV8Pgs9ccMeRg==
"@ant-design/pro-utils@2.15.2":
version "2.15.2"
resolved "https://registry.yarnpkg.com/@ant-design/pro-utils/-/pro-utils-2.15.2.tgz#d8a6cdd506842ea0d6d6cabb85e2e247bc096977"
integrity sha512-kzMT658CGrQqoihKPlZhbnRioovwMhM59vqqVXuT6A+IuyxJhs5pxN73C6sN2+ZoeYCo/Gewnfn9v1/2vHU2Zg==
dependencies:
"@ant-design/icons" "^5.0.0"
"@ant-design/pro-provider" "2.11.1"
"@ant-design/pro-provider" "2.13.5"
"@babel/runtime" "^7.18.0"
classnames "^2.3.2"
dayjs "^1.11.9"
dayjs "^1.11.10"
lodash.merge "^4.6.2"
rc-util "^5.0.6"
safe-stable-stringify "^2.4.3"
swr "^2.0.0"

"@ant-design/react-slick@~1.0.2":
Expand Down Expand Up @@ -1545,7 +1545,7 @@ [email protected]:
dependencies:
"@babel/runtime" "^7.21.0"

[email protected], dayjs@^1.11.1, dayjs@^1.11.9:
[email protected], dayjs@^1.11.1, dayjs@^1.11.10:
version "1.11.10"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
Expand Down Expand Up @@ -3520,6 +3520,11 @@ run-parallel@^1.1.9:
dependencies:
queue-microtask "^1.2.2"

safe-stable-stringify@^2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886"
integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==

"safer-buffer@>= 2.1.2 < 3.0.0":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
Expand Down Expand Up @@ -3827,16 +3832,6 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"

use-json-comparison@^1.0.3:
version "1.0.6"
resolved "https://registry.yarnpkg.com/use-json-comparison/-/use-json-comparison-1.0.6.tgz#a012bbc258ce745db1f56745dc653f575226cb21"
integrity sha512-xPadt5yMRbEmVfOSGFSMqjjICrq7nLbfSH3rYIXsrtcuFX7PmbYDN/ku8ObBn3v8o/yZelO1OxUS5+5TI3+fUw==

use-media-antd-query@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/use-media-antd-query/-/use-media-antd-query-1.1.0.tgz#f083ad7e292c1c0261b6bbfaac0edc3e0920d85d"
integrity sha512-B6kKZwNV4R+l4Rl11sWO7HqOay9alzs1Vp1b4YJqjz33YxbltBCZtt/yxXxkXN9rc1S7OeEL/GbwC30Wmqhw6Q==

use-sync-external-store@^1.0.0, use-sync-external-store@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
Expand Down

0 comments on commit a3b4b40

Please sign in to comment.