chore: update cypress, github actions and fix tests (#148)

This commit is contained in:
Faris Ansari 2022-01-05 17:57:02 +05:30 committed by GitHub
parent 6fcce176c3
commit 4549a5176b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 560 additions and 659 deletions

View File

@ -4,17 +4,19 @@ on:
branches: branches:
- master - master
jobs: jobs:
test: test-and-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - name: Lint, build and test
uses: cypress-io/github-action@v2
with: with:
node-version: '12' build: yarn lint-and-build
- run: yarn install --frozen-lockfile start: yarn cy:server
- run: yarn lint record: true
- run: yarn build env:
- run: yarn test CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release - name: Release
env: env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -1,14 +1,16 @@
name: Test Pull Request name: Test Pull Request
on: pull_request on: pull_request
jobs: jobs:
test: test-pull-request:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - name: Lint, build and test
uses: cypress-io/github-action@v2
with: with:
node-version: '12' build: yarn lint-and-build
- run: yarn install --frozen-lockfile start: yarn cy:server
- run: yarn lint record: true
- run: yarn build env:
- run: yarn test CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,3 +1,4 @@
{ {
"baseUrl": "http://localhost:8989" "baseUrl": "http://localhost:8989",
"projectId": "2nsyux"
} }

View File

@ -32,7 +32,7 @@ describe('Cell', function () {
}); });
it('edit cell', function () { it('edit cell', function () {
cy.getCell(4, 1).dblclick(); cy.getCell(4, 1).dblclick({ force: true });
cy.getCell(4, 1).find('input').click(); cy.getCell(4, 1).find('input').click();
cy.focused().type('{selectall}{del}Test{enter}'); cy.focused().type('{selectall}{del}Test{enter}');
cy.getCell(4, 1).contains('Test'); cy.getCell(4, 1).contains('Test');

View File

@ -14,36 +14,36 @@ describe('Inline Filters', function () {
cy.getCell(4, 0).click().type('{ctrl}f'); cy.getCell(4, 0).click().type('{ctrl}f');
cy.get('@filterInput4').type('edin'); cy.get('@filterInput4').type('edin');
cy.get('.dt-row[data-row-index=0]').should('be.visible'); cy.get('.dt-row-0').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible'); cy.get('.dt-row-1').should('not.exist');
cy.get('@filterInput4').clear(); cy.get('@filterInput4').clear();
}); });
it('simple number filter', function () { it('simple number filter', function () {
cy.get('@filterInput5').type('2360'); cy.get('@filterInput5').type('2360');
cy.get('.dt-row[data-row-index=8]').should('be.visible'); cy.get('.dt-row[data-row-index=8]').should('be.visible');
cy.get('.dt-row[data-row-index=15]').should('not.be.visible'); cy.get('.dt-row[data-row-index=15]').should('not.exist');
cy.get('.dt-row[data-row-index=22]').should('not.be.visible'); cy.get('.dt-row[data-row-index=22]').should('not.exist');
cy.get('@filterInput5').clear(); cy.get('@filterInput5').clear();
}); });
it('greater than', function () { it('greater than', function () {
cy.get('@filterInput5').type('> 6000'); cy.get('@filterInput5').type('> 6000');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible'); cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=3]').should('be.visible'); cy.get('.dt-row[data-row-index=3]').should('be.visible');
cy.get('@filterInput5').clear(); cy.get('@filterInput5').clear();
}); });
it('less than', function () { it('less than', function () {
cy.get('@filterInput5').type('< 2000'); cy.get('@filterInput5').type('< 2000');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible'); cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=51]').should('be.visible'); cy.get('.dt-row[data-row-index=51]').should('be.visible');
cy.get('@filterInput5').clear(); cy.get('@filterInput5').clear();
}); });
it('range', function () { it('range', function () {
cy.get('@filterInput5').type(' 2000: 5000'); cy.get('@filterInput5').type(' 2000: 5000');
cy.get('.dt-row[data-row-index=4]').should('not.be.visible'); cy.get('.dt-row[data-row-index=4]').should('not.exist');
cy.get('.dt-row[data-row-index=5]').should('be.visible'); cy.get('.dt-row[data-row-index=5]').should('be.visible');
cy.get('@filterInput5').clear(); cy.get('@filterInput5').clear();
}); });
@ -58,16 +58,15 @@ describe('Inline Filters', function () {
cy.get('@filterInput4').type('to'); cy.get('@filterInput4').type('to');
cy.get('@filterInput5').type('54'); cy.get('@filterInput5').type('54');
cy.get('.dt-row[data-row-index=0]').should('be.visible');
cy.get('.dt-row[data-row-index=4]').should('be.visible'); cy.get('.dt-row[data-row-index=4]').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible'); cy.get('.dt-row[data-row-index=1]').should('not.exist');
cy.get('@filterInput4').clear(); cy.get('@filterInput4').clear();
cy.get('@filterInput5').clear(); cy.get('@filterInput5').clear();
}); });
it('greater than for string type filters', function () { it('greater than for string type filters', function () {
cy.get('@filterInput6').type('> 01/07/2011'); cy.get('@filterInput6').type('> 01/07/2011');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible'); cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=1]').should('be.visible'); cy.get('.dt-row[data-row-index=1]').should('be.visible');
cy.get('.dt-row[data-row-index=3]').should('be.visible'); cy.get('.dt-row[data-row-index=3]').should('be.visible');
cy.get('.dt-row[data-row-index=5]').should('be.visible'); cy.get('.dt-row[data-row-index=5]').should('be.visible');

View File

@ -17,6 +17,7 @@
"travis-deploy-once": "travis-deploy-once", "travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release", "semantic-release": "semantic-release",
"lint": "eslint src", "lint": "eslint src",
"lint-and-build": "yarn lint && yarn build",
"commit": "npx git-cz" "commit": "npx git-cz"
}, },
"files": [ "files": [
@ -26,7 +27,7 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "^9.0.0", "autoprefixer": "^9.0.0",
"chai": "3.5.0", "chai": "3.5.0",
"cypress": "3.0.1", "cypress": "^9.2.0",
"cz-conventional-changelog": "^2.1.0", "cz-conventional-changelog": "^2.1.0",
"deepmerge": "^2.0.1", "deepmerge": "^2.0.1",
"eslint": "^5.0.1", "eslint": "^5.0.1",

1160
yarn.lock

File diff suppressed because it is too large Load Diff