]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Add E2E for languages
authorTiago Melo <tmelo@suse.com>
Mon, 4 May 2020 13:51:23 +0000 (13:51 +0000)
committerTiago Melo <tmelo@suse.com>
Tue, 7 Jul 2020 18:28:30 +0000 (18:28 +0000)
Fixes: https://tracker.ceph.com/issues/45376
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.e2e-spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.po.ts [new file with mode: 0644]

diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.e2e-spec.ts
new file mode 100644 (file)
index 0000000..fa20f0b
--- /dev/null
@@ -0,0 +1,19 @@
+import { LanguagePageHelper } from './language.po';
+
+describe('Shared pages', () => {
+  const language = new LanguagePageHelper();
+
+  beforeEach(() => {
+    cy.login();
+    language.navigateTo();
+  });
+
+  it('should check default language', () => {
+    language.getLanguageBtn().should('contain.text', 'English');
+  });
+
+  it('should check all available languages', () => {
+    language.getLanguageBtn().click();
+    language.getAllLanguages().should('have.length', 1).should('contain.text', 'English');
+  });
+});
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/language.po.ts
new file mode 100644 (file)
index 0000000..80e21ba
--- /dev/null
@@ -0,0 +1,15 @@
+import { PageHelper } from '../page-helper.po';
+
+export class LanguagePageHelper extends PageHelper {
+  pages = {
+    index: { url: '#/dashboard', id: 'cd-dashboard' }
+  };
+
+  getLanguageBtn() {
+    return cy.get('cd-language-selector a').first();
+  }
+
+  getAllLanguages() {
+    return cy.get('cd-language-selector button');
+  }
+}