-
Notifications
You must be signed in to change notification settings - Fork 13k
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
chore(frontend): uplift Cypress to v13 #29265
Draft
hainenber
wants to merge
20
commits into
apache:master
Choose a base branch
from
hainenber:uplift-cypress-to-v13
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3f56ab8
feat(frontend): uplift Cypress to v11
hainenber eeb8d86
fix(ci): uplift Cypress to v12 to fix failed post-v11 E2E failure
hainenber 18c8ced
fix(ci): remove obsolete workaround for Cypress <12.15.0
hainenber 3dda2cb
chore(build): disable interruptive Cypress 12's ESLint rule
hainenber 3536dca
feat(build): uplift Cypress to v13 to fix incompatibility with Webpack 5
hainenber 72d8cf3
fix(ci): preserve cookie across test for Cypress v12
hainenber 13f5c79
chore: fix ESlint issue
hainenber 54c9de7
fix(e2e): fix failed E2E test in Cypress 13 by disabling test isolation
hainenber e323cb9
chore(e2e): remove deprecated Cypress config
hainenber 0675daf
fix(e2e): fix leftover failed E2E tests
hainenber 61a408c
fix(e2e): dedicated test setup for post-Cypress13's Bar Chart v2
hainenber b599862
fix(e2e): resolve failed `GaugeChart` test after upgrading Cypress to…
hainenber d0f8a25
fix(e2e): resolve failed `nativeFilters` test after upgrading Cypress…
hainenber 543c596
chore: fix ESLint error
hainenber db4985a
fix(e2e): prevent renderer crash due to memory overconsumption
hainenber bec8da1
Revert "fix(e2e): prevent renderer crash due to memory overconsumption"
hainenber 6bbb7ac
fix(e2e): increase retries for flaky test + skip a weirdly running `n…
hainenber f4dbbad
chore: execute `npm run lint-fix`
hainenber af476bb
fix(e2e): prevent renderer crash due to memory overconsumption
hainenber b46baff
Merge branch 'master' into uplift-cypress-to-v13
hainenber 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
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
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 |
---|---|---|
|
@@ -219,15 +219,15 @@ const testEchart = ( | |
}); | ||
}; | ||
|
||
describe('Drill by modal', () => { | ||
describe('Drill by modal', { testIsolation: false }, () => { | ||
beforeEach(() => { | ||
closeModal(); | ||
}); | ||
before(() => { | ||
cy.visit(SUPPORTED_CHARTS_DASHBOARD); | ||
}); | ||
|
||
describe('Modal actions + Table', () => { | ||
describe('Modal actions + Table', { testIsolation: false }, () => { | ||
before(() => { | ||
closeModal(); | ||
openTopLevelTab('Tier 1'); | ||
|
@@ -375,7 +375,7 @@ describe('Drill by modal', () => { | |
}); | ||
}); | ||
|
||
describe('Tier 1 charts', () => { | ||
describe('Tier 1 charts', { testIsolation: false }, () => { | ||
before(() => { | ||
closeModal(); | ||
openTopLevelTab('Tier 1'); | ||
|
@@ -524,10 +524,141 @@ describe('Drill by modal', () => { | |
}); | ||
|
||
it('Bar Chart V2', () => { | ||
testEchart('echarts_timeseries_bar', 'Bar Chart V2', [ | ||
const vizType = 'echarts_timeseries_bar'; | ||
const chartName = 'Bar Chart V2'; | ||
const drillClickCoordinates = [ | ||
[70, 94], | ||
[362, 68], | ||
]); | ||
[362, 474], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it's due to Cypress upgrade or else but the previous coordinates were flaky. I have to manually tinker around to pick out the least "flaky" coordinates to pass local CI |
||
]; | ||
const furtherDrillDimension = 'name'; | ||
|
||
cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => { | ||
// click 'boy' | ||
cy.wrap($canvas) | ||
.scrollIntoView() | ||
.trigger( | ||
'mouseover', | ||
drillClickCoordinates[0][0], | ||
drillClickCoordinates[0][1], | ||
) | ||
.rightclick(drillClickCoordinates[0][0], drillClickCoordinates[0][1]); | ||
|
||
drillBy('state').then(intercepted => { | ||
verifyExpectedFormData(intercepted, { | ||
groupby: ['state'], | ||
adhoc_filters: [ | ||
{ | ||
clause: 'WHERE', | ||
comparator: 'boy', | ||
expressionType: 'SIMPLE', | ||
operator: '==', | ||
operatorId: 'EQUALS', | ||
subject: 'gender', | ||
}, | ||
], | ||
}); | ||
}); | ||
|
||
cy.getBySel(`"Drill by: ${chartName}-modal"`).as('drillByModal'); | ||
|
||
cy.get('@drillByModal') | ||
.find('.draggable-trigger') | ||
.should('contain', chartName); | ||
|
||
cy.get('@drillByModal') | ||
.find('.ant-breadcrumb') | ||
.should('be.visible') | ||
.and('contain', 'gender (boy)') | ||
.and('contain', '/') | ||
.and('contain', 'state'); | ||
|
||
cy.get('@drillByModal') | ||
.find('[data-test="drill-by-chart"]') | ||
.should('be.visible'); | ||
|
||
// further drill | ||
cy.get(`[data-test="drill-by-chart"] canvas`).then($canvas => { | ||
// click 'other' | ||
cy.wrap($canvas) | ||
.scrollIntoView() | ||
.trigger( | ||
'mouseenter', | ||
drillClickCoordinates[1][0], | ||
drillClickCoordinates[1][1], | ||
) | ||
.rightclick( | ||
drillClickCoordinates[1][0], | ||
drillClickCoordinates[1][1], | ||
); | ||
|
||
drillBy(furtherDrillDimension).then(intercepted => { | ||
const actualFormData = intercepted.request.body?.form_data; | ||
expect(actualFormData.groupby).to.eql([furtherDrillDimension]); | ||
expect(actualFormData.adhoc_filters).to.have.length(2); | ||
expect(actualFormData.adhoc_filters[0]).to.eql({ | ||
clause: 'WHERE', | ||
comparator: 'boy', | ||
expressionType: 'SIMPLE', | ||
operator: '==', | ||
operatorId: 'EQUALS', | ||
subject: 'gender', | ||
}); | ||
Object.entries({ | ||
clause: 'WHERE', | ||
expressionType: 'SIMPLE', | ||
operator: '==', | ||
operatorId: 'EQUALS', | ||
subject: 'state', | ||
}).forEach(([key, val]) => { | ||
expect(actualFormData.adhoc_filters[1][key]).to.eql(val); | ||
}); | ||
}); | ||
|
||
cy.get('@drillByModal') | ||
.find('[data-test="drill-by-chart"]') | ||
.should('be.visible'); | ||
|
||
// undo - back to drill by state | ||
interceptV1ChartData('drillByUndo'); | ||
cy.get('@drillByModal') | ||
.find('.ant-breadcrumb') | ||
.should('be.visible') | ||
.and('contain', 'gender (boy)') | ||
.and('contain', '/') | ||
.and('contain', 'state') | ||
.and('contain', furtherDrillDimension) | ||
.contains('state (') | ||
.click(); | ||
cy.wait('@drillByUndo').then(intercepted => { | ||
verifyExpectedFormData(intercepted, { | ||
groupby: ['state'], | ||
adhoc_filters: [ | ||
{ | ||
clause: 'WHERE', | ||
comparator: 'boy', | ||
expressionType: 'SIMPLE', | ||
operator: '==', | ||
operatorId: 'EQUALS', | ||
subject: 'gender', | ||
}, | ||
], | ||
}); | ||
}); | ||
|
||
cy.get('@drillByModal') | ||
.find('.ant-breadcrumb') | ||
.should('be.visible') | ||
.and('contain', 'gender (boy)') | ||
.and('contain', '/') | ||
.and('not.contain', furtherDrillDimension) | ||
.and('not.contain', 'state (') | ||
.and('contain', 'state'); | ||
|
||
cy.get('@drillByModal') | ||
.find('[data-test="drill-by-chart"]') | ||
.should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
|
||
it('Pie Chart', () => { | ||
|
@@ -538,7 +669,7 @@ describe('Drill by modal', () => { | |
}); | ||
}); | ||
|
||
describe('Tier 2 charts', () => { | ||
describe('Tier 2 charts', { testIsolation: false }, () => { | ||
before(() => { | ||
closeModal(); | ||
openTopLevelTab('Tier 2'); | ||
|
@@ -588,7 +719,7 @@ describe('Drill by modal', () => { | |
it('Gauge Chart', () => { | ||
testEchart('gauge_chart', 'Gauge Chart', [ | ||
[151, 95], | ||
[300, 143], | ||
[300, NaN], // this fixes the test after upgrading to Cypress 13 | ||
]); | ||
}); | ||
|
||
|
Oops, something went wrong.
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.
I see we are doing
{ testIsolation: false }
in the describe blocks, is there a reason to not just add that to the config instead?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.
It's due to default test isolation in Cypress 12. While there are many tests sharing context, as evidenced by the amount of
{ testIsolation: false }
, the remaining are isolated and should be encouraged instead.We'll probably need to refactor these context-sharing tests later to be isolated in future PRs.