From 966125b1dd99c49d0f3136cc6fd9f04c539d4d83 Mon Sep 17 00:00:00 2001 From: Dima May Date: Tue, 21 May 2024 20:11:12 +0000 Subject: [PATCH] #2490: added dashboard skills (inception) views and all the associated cypress tests --- .github/workflows/build-and-test.yml | 2 +- .../src/components/header/DashboardHeader.vue | 7 +- .../components/header/SkillsBreadcrumb.vue | 7 +- .../components/inception /InceptionButton.vue | 37 +++ .../components/inception /InceptionSkills.vue | 32 ++ .../myProgress/MyProjectSkillsPage.vue | 2 +- .../discover/DiscoverProjectsPage.vue | 8 +- dashboard-prime/src/router/AdminRoutes.js | 2 +- .../router/SkillsDisplayPathAppendValues.js | 3 +- .../src/router/UseGlobalNavGuards.js | 2 +- dashboard-prime/src/router/index.js | 14 + .../skills-display/UseSkillsDisplayInfo.js | 3 + .../components/badges/BadgeCatalogItem.vue | 2 +- .../stores/UseUserProgressSummaryState.js | 1 + .../inception/inception_breadcrumb_spec.js | 281 ++---------------- .../cypress/e2e/inception/inception_spec.js | 113 +++++++ 16 files changed, 252 insertions(+), 264 deletions(-) create mode 100644 dashboard-prime/src/components/inception /InceptionButton.vue create mode 100644 dashboard-prime/src/components/inception /InceptionSkills.vue create mode 100644 e2e-tests/cypress/e2e/inception/inception_spec.js diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e0f8553707..c72c09cd4e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -140,7 +140,7 @@ jobs: - name: Run Cypress tests run: | cd e2e-tests - ../.github/scripts/runSubsetOfCypressTests.sh -t 6 -c ${{ matrix.container }} -f 'projects_crud|/skills_table_spec|/skill_reuse_spec|quiz_creation|question_def|metrics-reUsedData_spec|quiz_and_survey|quiz_runs|quiz_skill_assignment|quiz_read|quiz_role|quiz_settings|quiz_skills-in_project_reuse|client-display_quiz_spec|client-display_quiz_theme_spec|client-display_quiz_visual_spec|client-display_run_quiz_spec|run_survey_spec|quiz_skills-catalog_spec|inception_skills_spec|user_actions|configure-skill-expiration_spec|skill-expiration-table_spec|/skills_spec|/users_spec|/subjects_spec|/levels_management_spec|/skills_group_spec|/skills_group_modal_spec|/move-skills/|/badges_spec|/skill-reuse/skill_reuse/|/catalog/|/project_settings_spec|/icon_manager_spec|/not_found_spec|/error_pages_spec|/add_skills_to_badge_spec|/tag-skills|/settings_spec|/client-display/|/learning-path/|/copy_project_spec|/project_errors_spec|/selfReport-approvalHistory_spec|/approver_conf_skills_spec|/approver_conf_spec|/approver_conf_userTags_spec|/approver_conf_users_spec|/approver_role_project_table_spec|/approver_role_spec|/manage-my-projects_spec' + ../.github/scripts/runSubsetOfCypressTests.sh -t 6 -c ${{ matrix.container }} -f 'projects_crud|/skills_table_spec|/skill_reuse_spec|quiz_creation|question_def|metrics-reUsedData_spec|quiz_and_survey|quiz_runs|quiz_skill_assignment|quiz_read|quiz_role|quiz_settings|quiz_skills-in_project_reuse|client-display_quiz_spec|client-display_quiz_theme_spec|client-display_quiz_visual_spec|client-display_run_quiz_spec|run_survey_spec|quiz_skills-catalog_spec|/inception|user_actions|configure-skill-expiration_spec|skill-expiration-table_spec|/skills_spec|/users_spec|/subjects_spec|/levels_management_spec|/skills_group_spec|/skills_group_modal_spec|/move-skills/|/badges_spec|/skill-reuse/skill_reuse/|/catalog/|/project_settings_spec|/icon_manager_spec|/not_found_spec|/error_pages_spec|/add_skills_to_badge_spec|/tag-skills|/settings_spec|/client-display/|/learning-path/|/copy_project_spec|/project_errors_spec|/selfReport-approvalHistory_spec|/approver_conf_skills_spec|/approver_conf_spec|/approver_conf_userTags_spec|/approver_conf_users_spec|/approver_role_project_table_spec|/approver_role_spec|/manage-my-projects_spec' cd .. env: ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu' diff --git a/dashboard-prime/src/components/header/DashboardHeader.vue b/dashboard-prime/src/components/header/DashboardHeader.vue index aa920431be..8509fd342f 100644 --- a/dashboard-prime/src/components/header/DashboardHeader.vue +++ b/dashboard-prime/src/components/header/DashboardHeader.vue @@ -4,6 +4,7 @@ import HelpButton from '@/components/header/HelpButton.vue' import SkillsBreadcrumb from '@/components/header/SkillsBreadcrumb.vue' import { usePagePath } from '@/components/utils/UsePageLocation.js' import SwitchTheme from '@/components/header/SwitchTheme.vue' +import InceptionButton from '@/components/inception /InceptionButton.vue' const pathPath = usePagePath() @@ -37,12 +38,14 @@ const pathPath = usePagePath() src="@/assets/img/skilltree_logo_v1.png" alt="skilltree logo" /> -
ADMIN
+
ADMIN
- + diff --git a/dashboard-prime/src/components/header/SkillsBreadcrumb.vue b/dashboard-prime/src/components/header/SkillsBreadcrumb.vue index 8b09b535b3..70cbfc120a 100644 --- a/dashboard-prime/src/components/header/SkillsBreadcrumb.vue +++ b/dashboard-prime/src/components/header/SkillsBreadcrumb.vue @@ -122,7 +122,12 @@ const buildBreadcrumb = () => { if (key) { if (!shouldExcludeKey(key)) { - newItems.push(buildResItem(key, value, res, index)) + console.log(`key: ${key}, value: ${value}`) + if (key?.toLowerCase() === 'skills' && value?.toLowerCase() === 'inception') { + newItems.push(buildResItem(null, 'Dashboard Skills', res, index)) + } else { + newItems.push(buildResItem(key, value, res, index)) + } } key = null } else { diff --git a/dashboard-prime/src/components/inception /InceptionButton.vue b/dashboard-prime/src/components/inception /InceptionButton.vue new file mode 100644 index 0000000000..d545cca626 --- /dev/null +++ b/dashboard-prime/src/components/inception /InceptionButton.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/dashboard-prime/src/components/inception /InceptionSkills.vue b/dashboard-prime/src/components/inception /InceptionSkills.vue new file mode 100644 index 0000000000..fc7293bab5 --- /dev/null +++ b/dashboard-prime/src/components/inception /InceptionSkills.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/dashboard-prime/src/components/myProgress/MyProjectSkillsPage.vue b/dashboard-prime/src/components/myProgress/MyProjectSkillsPage.vue index c3ec7856ed..8caf2feccd 100644 --- a/dashboard-prime/src/components/myProgress/MyProjectSkillsPage.vue +++ b/dashboard-prime/src/components/myProgress/MyProjectSkillsPage.vue @@ -18,7 +18,7 @@ onMounted(() => { diff --git a/dashboard-prime/src/components/myProgress/discover/DiscoverProjectsPage.vue b/dashboard-prime/src/components/myProgress/discover/DiscoverProjectsPage.vue index 06acf55a2a..20d45d60db 100644 --- a/dashboard-prime/src/components/myProgress/discover/DiscoverProjectsPage.vue +++ b/dashboard-prime/src/components/myProgress/discover/DiscoverProjectsPage.vue @@ -13,11 +13,13 @@ import ProjectDescriptionRow from '@/components/myProgress/discover/ProjectDescr import { useMyProgressState } from '@/stores/UseMyProgressState.js' import NoProjectsInCatalogMsg from '@/components/myProgress/discover/NoProjectsInCatalogMsg.vue' import HighlightedValue from '@/components/utils/table/HighlightedValue.vue' +import { useColors } from '@/skills-display/components/utilities/UseColors.js' const responsive = useResponsiveBreakpoints() const announcer = useSkillsAnnouncer() const appInfoState = useAppInfoState() const myProgressState = useMyProgressState() +const colors = useColors() const isLoading = ref(true) const searchValue = ref('') @@ -193,19 +195,19 @@ const contactProject = (name, id) => {
diff --git a/dashboard-prime/src/router/AdminRoutes.js b/dashboard-prime/src/router/AdminRoutes.js index 1c4e28796f..41d73046bf 100644 --- a/dashboard-prime/src/router/AdminRoutes.js +++ b/dashboard-prime/src/router/AdminRoutes.js @@ -2,6 +2,7 @@ import AdminHomePage from '@/components/AdminHomePage.vue' import MyProjects from '@/components/projects/MyProjects.vue' import QuizDefinitionsPage from '@/components/quiz/QuizDefinitionsPage.vue' import UserActionsPage from '@/components/userActions/UserActionsPage.vue'; +import InceptionSkills from '@/components/inception /InceptionSkills.vue' const createAdminRoutes = () => { return { @@ -45,7 +46,6 @@ const createAdminRoutes = () => { }, }, } - ] } } diff --git a/dashboard-prime/src/router/SkillsDisplayPathAppendValues.js b/dashboard-prime/src/router/SkillsDisplayPathAppendValues.js index 10f3f0c87f..7b146e854f 100644 --- a/dashboard-prime/src/router/SkillsDisplayPathAppendValues.js +++ b/dashboard-prime/src/router/SkillsDisplayPathAppendValues.js @@ -1,5 +1,6 @@ export default { Local: 'Local', SkillsClient: 'SkillsClient', - LocalTest: 'LocalTest' + LocalTest: 'LocalTest', + Inception: 'Inception', }; \ No newline at end of file diff --git a/dashboard-prime/src/router/UseGlobalNavGuards.js b/dashboard-prime/src/router/UseGlobalNavGuards.js index 42fbb2badd..faca75df8f 100644 --- a/dashboard-prime/src/router/UseGlobalNavGuards.js +++ b/dashboard-prime/src/router/UseGlobalNavGuards.js @@ -37,7 +37,7 @@ export const useGlobalNavGuards = () => { const log = useLog() - const isAdminPage = (route) => route.path.startsWith('/administrator') + const isAdminPage = (route) => route.path.startsWith('/administrator') && !route.path.startsWith('/administrator/skills') const isActiveProjectIdChange = (to, from) => to.params.projectId !== from.params.projectId const isLoggedIn = () => authState.isAuthenticated const isPki = () => appConfig.isPkiAuthenticated diff --git a/dashboard-prime/src/router/index.js b/dashboard-prime/src/router/index.js index b142dc46ad..0aa393e6fb 100644 --- a/dashboard-prime/src/router/index.js +++ b/dashboard-prime/src/router/index.js @@ -49,6 +49,7 @@ import createSkillsDisplayChildRoutes from '@/router/SkillsDisplayChildRoutes.js import TestSkillsClient from '@/skills-display/components/test/TestSkillsClient.vue' import TestSkillsDisplay from '@/skills-display/components/test/TestSkillsDisplay.vue' import PathAppendValues from '@/router/SkillsDisplayPathAppendValues.js' +import InceptionSkills from '@/components/inception /InceptionSkills.vue' const routes = [ { @@ -85,6 +86,19 @@ const routes = [ }, }, }, + { + path: '/administrator/skills/:projectId', + name: 'InceptionSkills', + component: InceptionSkills, + meta: { + requiresAuth: true, + reportSkillId: 'VisitDashboardSkills', + announcer: { + message: 'Dashboard Skills', + }, + }, + children: createSkillsDisplayChildRoutes(PathAppendValues.Inception) + }, { path: '/settings', component: GlobalSettings, diff --git a/dashboard-prime/src/skills-display/UseSkillsDisplayInfo.js b/dashboard-prime/src/skills-display/UseSkillsDisplayInfo.js index 3351cf2244..4bd2038f50 100644 --- a/dashboard-prime/src/skills-display/UseSkillsDisplayInfo.js +++ b/dashboard-prime/src/skills-display/UseSkillsDisplayInfo.js @@ -23,6 +23,9 @@ export const useSkillsDisplayInfo = () => { if (route.path.startsWith('/progress-and-rankings')) { return `${name}${localContextAppend}` } + if (route.path.startsWith('/administrator/skills')) { + return `${name}${SkillsDisplayPathAppendValues.Inception}` + } return `${name}${localTestContextAppend}` } diff --git a/dashboard-prime/src/skills-display/components/badges/BadgeCatalogItem.vue b/dashboard-prime/src/skills-display/components/badges/BadgeCatalogItem.vue index 6b006ab0d3..19f14645ff 100644 --- a/dashboard-prime/src/skills-display/components/badges/BadgeCatalogItem.vue +++ b/dashboard-prime/src/skills-display/components/badges/BadgeCatalogItem.vue @@ -161,7 +161,7 @@ const otherUsersAchieved = computed(() => {

- +

diff --git a/dashboard-prime/src/skills-display/stores/UseUserProgressSummaryState.js b/dashboard-prime/src/skills-display/stores/UseUserProgressSummaryState.js index 38cffa3a35..7701b2b224 100644 --- a/dashboard-prime/src/skills-display/stores/UseUserProgressSummaryState.js +++ b/dashboard-prime/src/skills-display/stores/UseUserProgressSummaryState.js @@ -21,6 +21,7 @@ export const useUserProgressSummaryState = defineStore('userProgressSummaryState return {} } const loadUserProgressSummary = () => { + console.log(`loadUserProgressSummary for ${attributes.projectId}`) return axios.get(`${attributes.serviceUrl}${servicePath}/${encodeURIComponent(attributes.projectId)}/summary`, { params: getUserIdAndVersionParams() }).then((result) => { diff --git a/e2e-tests/cypress/e2e/inception/inception_breadcrumb_spec.js b/e2e-tests/cypress/e2e/inception/inception_breadcrumb_spec.js index b564e8c7b1..fde0327e67 100644 --- a/e2e-tests/cypress/e2e/inception/inception_breadcrumb_spec.js +++ b/e2e-tests/cypress/e2e/inception/inception_breadcrumb_spec.js @@ -106,267 +106,44 @@ describe('My Progress Breadcrumb Tests', () => { cy.loginAsDefaultUser(); }); - it('test breadcrumbs starting on Admin page', function () { - cy.visit('/administrator'); - cy.get('[data-cy=inception-button]') - .click(); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .contains('Dashboard Skills') - .should('be.visible'); - - cy.dashboardCd() - .contains('Overall Points'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('be.visible'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('not.have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains('Dashboard Skills') - .should('be.visible'); - }); + it('test breadcrumbs starting on Rank page', function () { + cy.visit('/administrator/skills/inception/rank'); - it('test breadcrumbs starting on Project Overview page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/'); - - cy.dashboardCd() - .contains('Overall Points'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('be.visible'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('not.have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains('Dashboard Skills') - .should('be.visible'); - }); + cy.get('[data-cy="title"]').contains('My Rank'); + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Projects"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"]').should('have.length', 2) + cy.get('[data-pc-name="breadcrumb"] [data-cy="breadcrumb-Rank"]') - it('test breadcrumbs starting on Rank page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/rank'); - - cy.dashboardCd() - .contains('My Rank'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-Rank]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Rank]') - .should('not.have.attr', 'href'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Projects.*Dashboard Skills.*Rank.*$/)) - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-item]') - .its('length') - .should('eq', 3); - cy.get('[data-cy=breadcrumb-item]') - .eq(0) - .should('contain.text', 'Projects'); - cy.get('[data-cy=breadcrumb-item]') - .eq(1) - .should('contain.text', 'Dashboard Skills'); - cy.get('[data-cy=breadcrumb-item]') - .eq(2) - .should('contain.text', 'Rank'); - - // back to home page - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .click(); - cy.dashboardCd() - .contains('Overall Points'); - }); - it('test breadcrumbs starting on Subject page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/subjects/Dashboard'); - - cy.dashboardCd() - .contains('Dashboard'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('not.have.attr', 'href'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Projects.*Dashboard Skills.*Subject:\s+Dashboard.*$/)) - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-item]') - .its('length') - .should('eq', 3); - cy.get('[data-cy=breadcrumb-item]') - .eq(0) - .should('contain.text', 'Projects'); - cy.get('[data-cy=breadcrumb-item]') - .eq(1) - .should('contain.text', 'Dashboard Skills'); - cy.get('[data-cy=breadcrumb-item]') - .eq(2) - .should('contain.text', 'Subject: Dashboard'); - - // back to home page - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .click(); - cy.dashboardCd() - .contains('Overall Points'); - }); + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]').click() + cy.get('[data-cy="title"]').contains('Dashboard Skills'); - it('test breadcrumbs starting on Skill page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/subjects/Dashboard/skills/VisitDashboardSkills'); - - cy.dashboardCd() - .contains('Visit Dashboard Skills'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-VisitDashboardSkills]') - .should('exist'); - cy.get('[data-cy=breadcrumb-VisitDashboardSkills]') - .should('not.have.attr', 'href'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('have.attr', 'href'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Projects.*Dashboard Skills.*Subject:\s+Dashboard.*Skill:\s+VisitDashboardSkills$/)) - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-item]') - .its('length') - .should('eq', 4); - cy.get('[data-cy=breadcrumb-item]') - .eq(0) - .should('contain.text', 'Projects'); - cy.get('[data-cy=breadcrumb-item]') - .eq(1) - .should('contain.text', 'Dashboard Skills'); - cy.get('[data-cy=breadcrumb-item]') - .eq(2) - .should('contain.text', 'Subject: Dashboard'); - cy.get('[data-cy=breadcrumb-item]') - .eq(3) - .should('contain.text', 'Skill: VisitDashboardSkills'); - - // back to home page - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .click(); - cy.dashboardCd() - .contains('Overall Points'); + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Projects"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"]').should('have.length', 1) + cy.get('[data-pc-name="breadcrumb"] [data-cy="breadcrumb-Dashboard Skills"]') }); it('test breadcrumbs starting on Skill page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/subjects/Dashboard/skills/VisitDashboardSkills'); - - cy.dashboardCd() - .contains('Visit Dashboard Skill'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-VisitDashboardSkills]') - .should('exist'); - cy.get('[data-cy=breadcrumb-VisitDashboardSkills]') - .should('not.have.attr', 'href'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('have.attr', 'href'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Projects.*Dashboard Skills.*Subject:\s+Dashboard.*Skill:\s+VisitDashboardSkills$/)) - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-item]') - .its('length') - .should('eq', 4); - cy.get('[data-cy=breadcrumb-item]') - .eq(0) - .should('contain.text', 'Projects'); - cy.get('[data-cy=breadcrumb-item]') - .eq(1) - .should('contain.text', 'Dashboard Skills'); - cy.get('[data-cy=breadcrumb-item]') - .eq(2) - .should('contain.text', 'Subject: Dashboard'); - cy.get('[data-cy=breadcrumb-item]') - .eq(3) - .should('contain.text', 'Skill: VisitDashboardSkills'); - - // back to home page - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .click(); - cy.dashboardCd() - .contains('Overall Points'); + cy.visit('/administrator/skills/Inception/subjects/Dashboard/skills/VisitDashboardSkills'); + + cy.get('[data-cy="title"]').contains('Skill Overview'); + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Projects"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"]').should('have.length', 3) + cy.get('[data-pc-name="breadcrumb"] [data-cy="breadcrumb-VisitDashboardSkills"]') + + + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard"]').click() + cy.get('[data-cy="title"]').contains('Dashboard'); + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Projects"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]') + cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"]').should('have.length', 2) + cy.get('[data-pc-name="breadcrumb"] [data-cy="breadcrumb-Dashboard"]') }); - it('test breadcrumbs starting on Subject Rank page', function () { - cy.visit('/administrator/skills?skillsClientDisplayPath=/subjects/Dashboard/rank'); - - cy.dashboardCd() - .contains('My Rank'); - cy.get('[data-cy="breadcrumb-Projects"]') - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-Rank]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Rank]') - .should('not.have.attr', 'href'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('exist'); - cy.get('[data-cy=breadcrumb-Dashboard]') - .should('have.attr', 'href'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('exist'); - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .should('have.attr', 'href'); - cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Projects.*Dashboard Skills.*Subject:\s+Dashboard.*Rank$/)) - .should('be.visible'); - - cy.get('[data-cy=breadcrumb-item]') - .its('length') - .should('eq', 4); - cy.get('[data-cy=breadcrumb-item]') - .eq(0) - .should('contain.text', 'Projects'); - cy.get('[data-cy=breadcrumb-item]') - .eq(1) - .should('contain.text', 'Dashboard Skills'); - cy.get('[data-cy=breadcrumb-item]') - .eq(2) - .should('contain.text', 'Subject: Dashboard'); - cy.get('[data-cy=breadcrumb-item]') - .eq(3) - .should('contain.text', 'Rank'); - - // back to home page - cy.get('[data-cy="breadcrumb-Dashboard Skills"]') - .click(); - cy.dashboardCd() - .contains('Overall Points'); - }); + }); diff --git a/e2e-tests/cypress/e2e/inception/inception_spec.js b/e2e-tests/cypress/e2e/inception/inception_spec.js new file mode 100644 index 0000000000..b44300ae4d --- /dev/null +++ b/e2e-tests/cypress/e2e/inception/inception_spec.js @@ -0,0 +1,113 @@ +/* + * Copyright 2020 SkillTree + * + * Licensed 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 + * + * https://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. + */ + + +describe('Inception Tests', () => { + + beforeEach(() => { + }); + + it('navigation to dashboard skills', function () { + cy.visit('/administrator/'); + cy.get('[data-cy="inception-button"]').click(); + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard Skills'); + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 3) + cy.get('[data-cy="pointHistoryChartNoData"]') + + // navigate to subject + cy.get('[data-cy="subjectTileBtn"]').eq(2).click(); + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard'); + cy.get('[data-cy="pointHistoryChartNoData"]') + + // navigate to skill + cy.get('[data-cy="skillProgressTitle-VisitDashboardSkills"] [data-cy="skillProgressTitle"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Skill Overview'); + + // back to subject + cy.go('back') + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard'); + cy.get('[data-cy="pointHistoryChartNoData"]') + + // to subject's rank + cy.get('[data-cy="myRankBtn"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('My Rank'); + cy.get('[data-cy="leaderboardTable"]') + + // back to subject + cy.go('back') + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard'); + cy.get('[data-cy="pointHistoryChartNoData"]') + + // up the breadcrumb to dashboard skill + cy.get('[data-cy="breadcrumb-Dashboard Skills"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard Skills'); + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 3) + cy.get('[data-cy="pointHistoryChartNoData"]') + + // to project's rank + cy.get('[data-cy="myRankBtn"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('My Rank'); + cy.get('[data-cy="leaderboardTable"]') + + // back to dashboard skills + cy.go('back') + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard Skills'); + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 3) + cy.get('[data-cy="pointHistoryChartNoData"]') + + // to badges + cy.get('[data-cy="myBadgesBtn"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('My Badges'); + + // to a specific badge + cy.get('[data-cy="badgeDetailsLink_CommunitySuperHero"]').click() + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Badge Details'); + }); + + + it('navigate to inception then to a catalog-based project then back to inception', function () { + cy.createProject(1) + cy.enableProdMode(1); + cy.createSubject(1, 1) + cy.createSkill(1, 1, 1, { selfReportingType: 'Approval' }) + cy.addToMyProjects(1); + + cy.visit('/administrator/'); + cy.get('[data-cy="inception-button"]').click(); + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard Skills'); + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 3) + cy.get('[data-cy="pointHistoryChartNoData"]') + cy.get('[data-cy="subjectTile-Projects"]') + + cy.get('[data-cy="skillTreeLogo"]').click() + cy.get('[data-cy="project-link-proj1"]').click() + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 1) + cy.get('[data-cy="pointHistoryChartNoData"]') + cy.get('[data-cy="subjectTile-subj1"]') + + cy.get('[data-cy="settings-button"]').click() + cy.get('[aria-label="Project Admin"] [data-pc-section="action"]').click() + + cy.get('[data-cy="inception-button"]').click(); + cy.get('[data-cy="skillsDisplayHome"] [data-cy="title"]').contains('Dashboard Skills'); + cy.get('[data-cy="subjectTileBtn"]').should('have.length', 3) + cy.get('[data-cy="pointHistoryChartNoData"]') + cy.get('[data-cy="subjectTile-Projects"]') + }) + + +}); +