From 7363bc3af1613f2b06eaf34ea8c57ee8f4583537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20Mart=C3=ADnez?= Date: Mon, 3 Jan 2022 17:43:07 +0100 Subject: [PATCH] mgr/dashboard: add test coverage for API docs (SwaggerUI) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://tracker.ceph.com/issues/53756 Signed-off-by: Alfonso Martínez --- .../cypress/integration/ui/api-docs.e2e-spec.ts | 15 +++++++++++++++ .../cypress/integration/ui/api-docs.po.ts | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.e2e-spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.po.ts diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.e2e-spec.ts new file mode 100644 index 00000000000..53c7c3ca8d7 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.e2e-spec.ts @@ -0,0 +1,15 @@ +import { ApiDocsPageHelper } from 'cypress/integration/ui/api-docs.po'; + +describe('Api Docs Page', () => { + const apiDocs = new ApiDocsPageHelper(); + + beforeEach(() => { + cy.login(); + Cypress.Cookies.preserveOnce('token'); + apiDocs.navigateTo(); + }); + + it('should show the API Docs description', () => { + cy.get('.renderedMarkdown').first().contains('This is the official Ceph REST API'); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.po.ts new file mode 100644 index 00000000000..c7a8d222d2c --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.po.ts @@ -0,0 +1,5 @@ +import { PageHelper } from '../page-helper.po'; + +export class ApiDocsPageHelper extends PageHelper { + pages = { index: { url: '#/api-docs', id: 'cd-api-docs' } }; +}