mirror of
https://github.com/apache/superset.git
synced 2026-07-19 13:15:49 +00:00
fix(e2e): small fixes for e2e
This commit is contained in:
@@ -51,7 +51,7 @@ function openProperties() {
|
||||
cy.getBySel('header-actions-menu')
|
||||
.contains('Edit properties')
|
||||
.click({ force: true });
|
||||
cy.get('.ant-modal-body').should('be.visible');
|
||||
cy.get('.antd5-modal-body').should('be.visible');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ function openExploreProperties() {
|
||||
cy.get('.ant-dropdown-menu')
|
||||
.contains('Edit chart properties')
|
||||
.click({ force: true });
|
||||
cy.get('.ant-modal-body').should('be.visible');
|
||||
cy.get('.antd5-modal-body').should('be.visible');
|
||||
}
|
||||
|
||||
function assertMetadata(text: string) {
|
||||
@@ -77,7 +77,7 @@ function assertMetadata(text: string) {
|
||||
}
|
||||
|
||||
function openAdvancedProperties() {
|
||||
cy.get('.ant-modal-body')
|
||||
cy.get('.antd5-modal-body')
|
||||
.contains('Advanced')
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
@@ -1100,7 +1100,7 @@ describe('Dashboard edit', () => {
|
||||
cy.allowConsoleErrors(['Error: A valid color scheme is required']);
|
||||
writeMetadata('{"color_scheme":"wrongcolorscheme"}');
|
||||
applyChanges();
|
||||
cy.get('.ant-modal-body')
|
||||
cy.get('.antd5-modal-body')
|
||||
.contains('A valid color scheme is required')
|
||||
.should('be.visible');
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('Datasource control', () => {
|
||||
cy.focused().type(`${newMetricName}{enter}`);
|
||||
|
||||
cy.get('[data-test="datasource-modal-save"]').click();
|
||||
cy.get('.ant-modal-confirm-btns button').contains('OK').click();
|
||||
cy.get('.antd5-modal-confirm-btns button').contains('OK').click();
|
||||
// select new metric
|
||||
cy.get('[data-test=metrics]')
|
||||
.contains('Drop columns/metrics here or click')
|
||||
@@ -68,7 +68,7 @@ describe('Datasource control', () => {
|
||||
// delete metric
|
||||
cy.get('[data-test="datasource-menu-trigger"]').click();
|
||||
cy.get('[data-test="edit-dataset"]').click();
|
||||
cy.get('.ant-modal-content').within(() => {
|
||||
cy.get('.antd5-modal-content').within(() => {
|
||||
cy.get('[data-test="collection-tab-Metrics"]')
|
||||
.contains('Metrics')
|
||||
.click();
|
||||
@@ -78,7 +78,7 @@ describe('Datasource control', () => {
|
||||
.find('[data-test="crud-delete-icon"]')
|
||||
.click();
|
||||
cy.get('[data-test="datasource-modal-save"]').click();
|
||||
cy.get('.ant-modal-confirm-btns button').contains('OK').click();
|
||||
cy.get('.antd5-modal-confirm-btns button').contains('OK').click();
|
||||
cy.get('[data-test="metrics"]').contains(newMetricName).should('not.exist');
|
||||
});
|
||||
});
|
||||
@@ -121,7 +121,7 @@ describe('VizType control', () => {
|
||||
|
||||
cy.contains('View all charts').click();
|
||||
|
||||
cy.get('.ant-modal-content').within(() => {
|
||||
cy.get('.antd5-modal-content').within(() => {
|
||||
cy.get('button').contains('KPI').click(); // change categories
|
||||
cy.get('[role="button"]').contains('Big Number').click();
|
||||
cy.get('button').contains('Select').click();
|
||||
|
||||
@@ -42,8 +42,8 @@ describe('Test explore links', () => {
|
||||
cy.wait('@chartData').then(() => {
|
||||
cy.get('code');
|
||||
});
|
||||
cy.get('.ant-modal-content').within(() => {
|
||||
cy.get('button.ant-modal-close').first().click({ force: true });
|
||||
cy.get('.antd5-modal-content').within(() => {
|
||||
cy.get('button.antd5-modal-close').first().click({ force: true });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ export const databasesPage = {
|
||||
infoAlert: '.antd5-alert',
|
||||
serviceAccountInput: '[name="credentials_info"]',
|
||||
connectionStep: {
|
||||
modal: '.ant-modal-content',
|
||||
modalBody: '.ant-modal-body',
|
||||
modal: '.antd5-modal-content',
|
||||
modalBody: '.antd5-modal-body',
|
||||
stepTitle: '.css-7x6kk > h4',
|
||||
helperBottom: '.helper-bottom',
|
||||
postgresDatabase: '[name="database"]',
|
||||
@@ -150,7 +150,7 @@ export const sqlLabView = {
|
||||
sqlEditor: '#brace-editor textarea',
|
||||
saveAsButton: '.SaveQuery > .ant-btn',
|
||||
saveAsModal: {
|
||||
footer: '.ant-modal-footer',
|
||||
footer: '.antd5-modal-footer',
|
||||
queryNameInput: 'input[class^="ant-input"]',
|
||||
},
|
||||
sqlToolbar: {
|
||||
@@ -199,12 +199,12 @@ export const annotationLayersView = {
|
||||
},
|
||||
modal: {
|
||||
content: {
|
||||
content: '.ant-modal-body',
|
||||
title: '.ant-modal-body > :nth-child(2) > input',
|
||||
content: '.antd5-modal-body',
|
||||
title: '.antd5-modal-body > :nth-child(2) > input',
|
||||
description: "[name='descr']",
|
||||
},
|
||||
footer: {
|
||||
footer: '.ant-modal-footer',
|
||||
footer: '.antd5-modal-footer',
|
||||
addButton: dataTestLocator('modal-confirm-button'),
|
||||
cancelButton: dataTestLocator('modal-cancel-button'),
|
||||
},
|
||||
@@ -216,7 +216,7 @@ export const datasetsList = {
|
||||
newDatasetModal: {
|
||||
inputField: '[class="section"]',
|
||||
addButton: dataTestLocator('modal-confirm-button'),
|
||||
body: '.ant-modal-body',
|
||||
body: '.antd5-modal-body',
|
||||
},
|
||||
table: {
|
||||
tableRow: {
|
||||
@@ -261,7 +261,7 @@ export const datasetsList = {
|
||||
},
|
||||
},
|
||||
deleteDatasetModal: {
|
||||
modal: '.ant-modal-content',
|
||||
modal: '.antd5-modal-content',
|
||||
deleteInput: dataTestLocator('delete-modal-input'),
|
||||
deleteButton: dataTestLocator('modal-confirm-button'),
|
||||
text: '.css-kxmt87',
|
||||
@@ -318,8 +318,8 @@ export const chartListView = {
|
||||
};
|
||||
export const nativeFilters = {
|
||||
modal: {
|
||||
container: '.ant-modal',
|
||||
footer: '.ant-modal-footer',
|
||||
container: '.antd5-modal',
|
||||
footer: '.antd5-modal-footer',
|
||||
saveButton: dataTestLocator('native-filter-modal-save-button'),
|
||||
cancelButton: dataTestLocator('native-filter-modal-cancel-button'),
|
||||
confirmCancelButton: dataTestLocator(
|
||||
@@ -476,15 +476,15 @@ export const exploreView = {
|
||||
},
|
||||
chartAreaItem: '.nv-legend-text',
|
||||
viewQueryModal: {
|
||||
container: '.ant-modal-content',
|
||||
closeButton: 'button.ant-modal-close',
|
||||
container: '.antd5-modal-content',
|
||||
closeButton: 'button.antd5-modal-close',
|
||||
},
|
||||
embedCodeModal: {
|
||||
container: dataTestLocator('embed-code-popover'),
|
||||
textfield: dataTestLocator('embed-code-textarea'),
|
||||
},
|
||||
saveModal: {
|
||||
modal: '.ant-modal-content',
|
||||
modal: '.antd5-modal-content',
|
||||
chartNameInput: dataTestLocator('new-chart-name'),
|
||||
dashboardNameInput: '.ant-select-selection-search-input',
|
||||
addToDashboardInput: dataTestLocator(
|
||||
@@ -580,7 +580,7 @@ export const exploreView = {
|
||||
},
|
||||
},
|
||||
editDatasetModal: {
|
||||
container: '.ant-modal-content',
|
||||
container: '.antd5-modal-content',
|
||||
datasetTabsContainer: dataTestLocator('edit-dataset-tabs'),
|
||||
saveButton: dataTestLocator('datasource-modal-save'),
|
||||
metricsTab: {
|
||||
@@ -588,7 +588,7 @@ export const exploreView = {
|
||||
rowsContainer: dataTestLocator('table-content-rows'),
|
||||
},
|
||||
confirmModal: {
|
||||
okButton: '.ant-modal-confirm-btns .ant-btn-primary',
|
||||
okButton: '.antd5-modal-confirm-btns .ant-btn-primary',
|
||||
},
|
||||
},
|
||||
visualizationTypeModal: {
|
||||
@@ -619,12 +619,12 @@ export const dashboardView = {
|
||||
closeButton: dataTestLocator('close-button'),
|
||||
},
|
||||
saveModal: {
|
||||
modal: '.ant-modal-content',
|
||||
modal: '.antd5-modal-content',
|
||||
dashboardNameInput: '.ant-input',
|
||||
saveButton: dataTestLocator('modal-save-dashboard-button'),
|
||||
},
|
||||
dashboardProperties: {
|
||||
modal: '.ant-modal-content',
|
||||
modal: '.antd5-modal-content',
|
||||
dashboardTitleInput: dataTestLocator('dashboard-title-input'),
|
||||
modalButton: '[type="button"]',
|
||||
},
|
||||
|
||||
@@ -33,6 +33,7 @@ const { getConfig, setConfig } = failOnConsoleError({
|
||||
'The pseudo class ":nth-child" is potentially unsafe when doing server-side rendering. Try changing it to ":nth-of-type".',
|
||||
'Error: Unknown Error',
|
||||
/Unable to infer path to ace from script src/,
|
||||
/$/
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ describe('DatabaseModal', () => {
|
||||
afterEach(cleanup);
|
||||
|
||||
describe('Visual: New database connection', () => {
|
||||
test('renders the initial load of Step 1 correctly', () => {
|
||||
test.only('renders the initial load of Step 1 correctly', () => {
|
||||
// ---------- Components ----------
|
||||
// <TabHeader> - AntD header
|
||||
const closeButton = screen.getByLabelText('Close');
|
||||
@@ -415,6 +415,7 @@ describe('DatabaseModal', () => {
|
||||
];
|
||||
|
||||
visibleComponents.forEach(component => {
|
||||
console.log(component)
|
||||
expect(component).toBeVisible();
|
||||
});
|
||||
// there should be a footer but it should not have any buttons in it
|
||||
|
||||
Reference in New Issue
Block a user