-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Applitools Cypress workflow #19956
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
cfadac4
WIP
geido 420e6f1
Attempt Github Actions integration
geido e99bb1a
Add completion notification to workflow
geido 0d36024
Update env
geido 0cdfaf7
Add new line
geido ff86ae5
Add license
geido 6426844
Fix whitespaces
geido 8d57b55
Fix Yaml indentation
geido 65c9a30
Fix afterEach
geido e59c6b4
Update conf
geido 7dfd4a5
Add initial tests
geido 69610bd
Update config
geido 7fc2307
Use test secret
geido dc14737
Clean up
geido ad0282a
Add batchName
geido 6a59439
Disable logs - add secret
geido 9c2bf43
Merge branch 'master' of https://github.com/apache/superset into feat…
geido f883cc2
Create separate workflow
geido 3355885
Clean up
geido 634da58
Update workflow
geido 5124d49
Exclude applitools tests
geido a4702f7
Update jobs name
geido e3a3bc8
Run applitools tests separetely
geido 85de6fd
Fix path pattern
geido 9395144
Run once
geido af9098f
Add more initial tests
geido 96551fb
Merge branch 'master' of https://github.com/apache/superset into feat…
geido c60626c
Enhance tests
geido fd44481
Add dashboard edit mode test
geido 769249c
Move env
geido 6e6cdb6
Exclude applitools from sqllab test run
geido 3ac0d8e
Attempt pull_request_target
geido 9bae1a3
Catch Applitools failures
geido 3e996c8
Clean up tests
geido 5315d78
Add test step
geido 904d5d2
Add test step
geido bb7c9d2
Remove step
geido fabd5b6
Merge branch 'master' of https://github.com/apache/superset into feat…
geido c7d6616
Merge branch 'master' of https://github.com/apache/superset into feat…
geido 3e34928
Fix SqlLab test
geido 4746b70
Update CURL request
geido 04eb874
Fix Yaml
geido 187f9a7
Add empty data to batch completion
geido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Applitools Cypress | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
cypress-applitools: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
browser: ["chrome"] | ||
env: | ||
FLASK_ENV: development | ||
SUPERSET_CONFIG: tests.integration_tests.superset_test_config | ||
SUPERSET__SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://superset:[email protected]:15432/superset | ||
PYTHONPATH: ${{ github.workspace }} | ||
REDIS_PORT: 16379 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
APPLITOOLS_APP_NAME: Superset | ||
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} | ||
APPLITOOLS_BATCH_ID: ${{ github.sha }} | ||
APPLITOOLS_BATCH_NAME: Superset Cypress | ||
services: | ||
postgres: | ||
image: postgres:14-alpine | ||
env: | ||
POSTGRES_USER: superset | ||
POSTGRES_PASSWORD: superset | ||
ports: | ||
- 15432:5432 | ||
redis: | ||
image: redis:5-alpine | ||
ports: | ||
- 16379:6379 | ||
steps: | ||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
submodules: recursive | ||
- name: Check if python or frontend changes are present | ||
id: check | ||
env: | ||
GITHUB_REPO: ${{ github.repository }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
continue-on-error: true | ||
run: ./scripts/ci_check_no_file_changes.sh python frontend | ||
- name: Setup Python | ||
if: steps.check.outcome == 'failure' | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: OS dependencies | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: apt-get-install | ||
- name: Install python dependencies | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: | | ||
pip-upgrade | ||
pip install -r requirements/testing.txt | ||
- name: Setup postgres | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: setup-postgres | ||
- name: Import test data | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: testdata | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
- name: Install npm dependencies | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: npm-install | ||
- name: Build javascript packages | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: build-instrumented-assets | ||
- name: Install cypress | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: cypress-install | ||
- name: Run Applitools Cypress | ||
if: steps.check.outcome == 'failure' | ||
uses: ./.github/actions/cached-dependencies | ||
env: | ||
CYPRESS_BROWSER: ${{ matrix.browser }} | ||
with: | ||
run: cypress-run-applitools | ||
batch-completion-notification: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
needs: cypress-applitools | ||
steps: | ||
- name: Update Applitools batch status | ||
uses: wei/[email protected] | ||
env: | ||
APPLITOOLS_BATCH_ID: ${{ github.sha }} | ||
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} | ||
with: | ||
args: -d "" -X POST https://eyesapi.applitools.com/api/externals/github/servers/github.com/commit/${{ env.APPLITOOLS_BATCH_ID }}/complete?apiKey=${{ env.APPLITOOLS_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
module.exports = { | ||
apiKey: process.env.APPLITOOLS_API_KEY, | ||
batchId: process.env.APPLITOOLS_BATCH_ID, | ||
batchName: process.env.APPLITOOLS_BATCH_NAME, | ||
browser: [{ width: 1000, height: 660, name: 'chrome' }], | ||
failCypressOnDiff: false, | ||
isDisabled: false, | ||
showLogs: false, | ||
testConcurrency: 10, | ||
}; |
46 changes: 46 additions & 0 deletions
46
superset-frontend/cypress-base/cypress/integration/chart_list/chartlist.applitools.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { CHART_LIST } from './chart_list.helper'; | ||
|
||
describe('charts list view', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit(CHART_LIST); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.eyesClose(); | ||
}); | ||
|
||
it('should load the Charts list', () => { | ||
cy.get('[aria-label="list-view"]').click(); | ||
cy.eyesOpen({ | ||
testName: 'Charts list-view', | ||
}); | ||
cy.eyesCheckWindow('Charts loaded'); | ||
}); | ||
|
||
it('should load the Charts card list', () => { | ||
cy.get('[aria-label="card-view"]').click(); | ||
cy.eyesOpen({ | ||
testName: 'Charts card-view', | ||
}); | ||
cy.eyesCheckWindow('Charts loaded'); | ||
}); | ||
}); |
56 changes: 56 additions & 0 deletions
56
superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.applitools.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { | ||
waitForChartLoad, | ||
WORLD_HEALTH_CHARTS, | ||
WORLD_HEALTH_DASHBOARD, | ||
} from './dashboard.helper'; | ||
|
||
describe('Dashboard load', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit(WORLD_HEALTH_DASHBOARD); | ||
WORLD_HEALTH_CHARTS.forEach(waitForChartLoad); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.eyesClose(); | ||
}); | ||
|
||
it('should load the Dashboard', () => { | ||
cy.eyesOpen({ | ||
testName: 'Dashboard page', | ||
}); | ||
cy.eyesCheckWindow('Dashboard loaded'); | ||
}); | ||
|
||
it('should load the Dashboard in edit mode', () => { | ||
cy.get('[data-test="dashboard-header"]') | ||
.find('[aria-label=edit-alt]') | ||
.click(); | ||
// wait for a chart to appear | ||
cy.get('[data-test="grid-container"]').find('.box_plot', { | ||
timeout: 10000, | ||
}); | ||
cy.eyesOpen({ | ||
testName: 'Dashboard edit mode', | ||
}); | ||
cy.eyesCheckWindow('Dashboard edit mode loaded'); | ||
}); | ||
}); |
46 changes: 46 additions & 0 deletions
46
...frontend/cypress-base/cypress/integration/dashboard_list/dashboardlist.applitools.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { DASHBOARD_LIST } from './dashboard_list.helper'; | ||
|
||
describe('dashboard list view', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit(DASHBOARD_LIST); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.eyesClose(); | ||
}); | ||
|
||
it('should load the Dashboards list', () => { | ||
cy.get('[aria-label="list-view"]').click(); | ||
cy.eyesOpen({ | ||
testName: 'Dashboards list-view', | ||
}); | ||
cy.eyesCheckWindow('Dashboards loaded'); | ||
}); | ||
|
||
it('should load the Dashboards card list', () => { | ||
cy.get('[aria-label="card-view"]').click(); | ||
cy.eyesOpen({ | ||
testName: 'Dashboards card-view', | ||
}); | ||
cy.eyesCheckWindow('Dashboards loaded'); | ||
}); | ||
}); |
41 changes: 41 additions & 0 deletions
41
superset-frontend/cypress-base/cypress/integration/explore/explore.applitools.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { FORM_DATA_DEFAULTS, NUM_METRIC } from './visualizations/shared.helper'; | ||
|
||
describe('explore view', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.intercept('POST', '/superset/explore_json/**').as('getJson'); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.eyesClose(); | ||
}); | ||
|
||
it('should load Explore', () => { | ||
const LINE_CHART_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'line' }; | ||
const formData = { ...LINE_CHART_DEFAULTS, metrics: [NUM_METRIC] }; | ||
cy.visitChartByParams(JSON.stringify(formData)); | ||
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' }); | ||
cy.eyesOpen({ | ||
testName: 'Explore page', | ||
}); | ||
cy.eyesCheckWindow('Explore loaded'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the significance of the name that you pass to
eyesCheckWindow
and do these names have to be unique? Looking at how these two tests here have the same string passed in.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently these are enclosed within each test... they don't need to be unique it seems.