From c5206c381a8d2fd6232fa5de28af0de6d1997414 Mon Sep 17 00:00:00 2001 From: SpiderMan Date: Tue, 17 May 2022 09:15:27 -0400 Subject: [PATCH 1/2] add cypress test for report page direct link issue --- .../alerts_and_reports/alert_report.helper.ts | 2 ++ .../alerts_and_reports/alerts.test.ts | 26 +++++++++++++++++++ .../alerts_and_reports/reports.test.ts | 26 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts create mode 100644 superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts create mode 100644 superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts new file mode 100644 index 0000000000000..010f7298f7113 --- /dev/null +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts @@ -0,0 +1,2 @@ +export const ALERT_LIST = '/alert/list/'; +export const REPORT_LIST = '/report/list/'; diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts new file mode 100644 index 0000000000000..61e35643cb6d9 --- /dev/null +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts @@ -0,0 +1,26 @@ +import { ALERT_LIST } from './alert_report.helper'; + +describe('alert list view', () => { + beforeEach(() => { + cy.login(); + }); + + afterEach(() => { + cy.eyesClose(); + }); + + it('should load alert lists', () => { + cy.visit(ALERT_LIST); + + cy.get('[data-test="listview-table"]').should('be.visible'); + // check alert list view header + cy.get('[data-test="sort-header"]').eq(1).contains('Last run'); + cy.get('[data-test="sort-header"]').eq(2).contains('Name'); + cy.get('[data-test="sort-header"]').eq(3).contains('Schedule'); + cy.get('[data-test="sort-header"]').eq(4).contains('Notification method'); + cy.get('[data-test="sort-header"]').eq(5).contains('Created by'); + cy.get('[data-test="sort-header"]').eq(6).contains('Owners'); + cy.get('[data-test="sort-header"]').eq(7).contains('Active'); + cy.get('[data-test="sort-header"]').eq(8).contains('Actions'); + }); +}); diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts new file mode 100644 index 0000000000000..cf3ac108bb153 --- /dev/null +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts @@ -0,0 +1,26 @@ +import { REPORT_LIST } from './alert_report.helper'; + +describe('report list view', () => { + beforeEach(() => { + cy.login(); + }); + + afterEach(() => { + cy.eyesClose(); + }); + + it('should load report lists', () => { + cy.visit(REPORT_LIST); + + cy.get('[data-test="listview-table"]').should('be.visible'); + // check report list view header + cy.get('[data-test="sort-header"]').eq(1).contains('Last run'); + cy.get('[data-test="sort-header"]').eq(2).contains('Name'); + cy.get('[data-test="sort-header"]').eq(3).contains('Schedule'); + cy.get('[data-test="sort-header"]').eq(4).contains('Notification method'); + cy.get('[data-test="sort-header"]').eq(5).contains('Created by'); + cy.get('[data-test="sort-header"]').eq(6).contains('Owners'); + cy.get('[data-test="sort-header"]').eq(7).contains('Active'); + cy.get('[data-test="sort-header"]').eq(8).contains('Actions'); + }); +}); From a5f8033c588cf352999e5c818907809fddc94ea2 Mon Sep 17 00:00:00 2001 From: SpiderMan Date: Tue, 17 May 2022 09:42:15 -0400 Subject: [PATCH 2/2] add licence --- .../alerts_and_reports/alert_report.helper.ts | 18 ++++++++++++++++++ .../alerts_and_reports/alerts.test.ts | 18 ++++++++++++++++++ .../alerts_and_reports/reports.test.ts | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts index 010f7298f7113..dcf8b2b4a2931 100644 --- a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alert_report.helper.ts @@ -1,2 +1,20 @@ +/** + * 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. + */ export const ALERT_LIST = '/alert/list/'; export const REPORT_LIST = '/report/list/'; diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts index 61e35643cb6d9..bc27e831b5afe 100644 --- a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts @@ -1,3 +1,21 @@ +/** + * 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 { ALERT_LIST } from './alert_report.helper'; describe('alert list view', () => { diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts index cf3ac108bb153..c3007cc1a87d7 100644 --- a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts @@ -1,3 +1,21 @@ +/** + * 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 { REPORT_LIST } from './alert_report.helper'; describe('report list view', () => {