]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: add test coverage for API docs (SwaggerUI)
authorAlfonso Martínez <almartin@redhat.com>
Mon, 3 Jan 2022 16:43:07 +0000 (17:43 +0100)
committerAlfonso Martínez <almartin@redhat.com>
Mon, 3 Jan 2022 16:43:07 +0000 (17:43 +0100)
Fixes: https://tracker.ceph.com/issues/53756
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.e2e-spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/cypress/integration/ui/api-docs.po.ts [new file with mode: 0644]

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 (file)
index 0000000..53c7c3c
--- /dev/null
@@ -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 (file)
index 0000000..c7a8d22
--- /dev/null
@@ -0,0 +1,5 @@
+import { PageHelper } from '../page-helper.po';
+
+export class ApiDocsPageHelper extends PageHelper {
+  pages = { index: { url: '#/api-docs', id: 'cd-api-docs' } };
+}