From dbf1328b6c652db728133592165de264c2820f16 Mon Sep 17 00:00:00 2001 From: Don Walizer <12420708+dwalizer@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:10:23 -0400 Subject: [PATCH 1/2] #2490 Fix skipped tests --- .../SelfReportApprovalConfUserTag.vue | 5 +- .../approver/approver_conf_userTags_spec.js | 8 +- .../import_skills_from_catalog_spec.js | 180 +----------------- .../e2e/my-progress_breadcrumb_spec.js | 11 +- 4 files changed, 14 insertions(+), 190 deletions(-) diff --git a/dashboard-prime/src/components/skills/selfReport/SelfReportApprovalConfUserTag.vue b/dashboard-prime/src/components/skills/selfReport/SelfReportApprovalConfUserTag.vue index c3a08e1b73..b54cf925c7 100644 --- a/dashboard-prime/src/components/skills/selfReport/SelfReportApprovalConfUserTag.vue +++ b/dashboard-prime/src/components/skills/selfReport/SelfReportApprovalConfUserTag.vue @@ -20,7 +20,6 @@ import SelfReportService from '@/components/skills/selfReport/SelfReportService' import { useSkillsAnnouncer } from '@/common-components/utilities/UseSkillsAnnouncer.js' import NoContent2 from "@/components/utils/NoContent2.vue"; import DateCell from "@/components/utils/table/DateCell.vue"; -import { SkillsReporter } from '@skilltree/skills-client-js'; import * as yup from "yup"; import {useForm} from "vee-validate"; @@ -34,9 +33,9 @@ const props = defineProps({ }); const schema = yup.object({ - 'tagInput': yup.string().required().test('uniqueName', 'There is already an entry for this value.', (value) => { + 'tagInput': yup.string().required().test('uniqueName', `There is already an entry for this ${props.tagLabel} value.`, (value) => { return !data.value.find((i) => value.toLowerCase() === i.userTagValue?.toLowerCase()); - }) + }).matches(/^\w+$/, () => `${props.tagLabel} may only contain alpha-numeric characters`) }) const { meta } = useForm({ validationSchema: schema diff --git a/e2e-tests/cypress/e2e/approver/approver_conf_userTags_spec.js b/e2e-tests/cypress/e2e/approver/approver_conf_userTags_spec.js index f845019c02..9180249ad3 100644 --- a/e2e-tests/cypress/e2e/approver/approver_conf_userTags_spec.js +++ b/e2e-tests/cypress/e2e/approver/approver_conf_userTags_spec.js @@ -166,7 +166,7 @@ describe('Approver Config User Tags Tests', () => { }); - it.skip('entering user tag conf validation', function () { + it('entering user tag conf validation', function () { const user1 = 'user1' cy.request('POST', `/admin/projects/proj1/users/user1/roles/ROLE_PROJECT_APPROVER`); @@ -177,15 +177,15 @@ describe('Approver Config User Tags Tests', () => { cy.get(`[data-cy="workloadCell_${user1}"] [data-cy="editApprovalBtn"]`).click() // no spaces cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="userTagValueInput"]`).type('s s'); - cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagValueInputError"]`).should('have.text', 'Org may only contain alpha-numeric characters') + cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagInputError"]`).should('have.text', 'Org may only contain alpha-numeric characters') cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="addTagKeyConfBtn"]`).should('not.be.enabled') cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="userTagValueInput"]`).type('{backspace}{backspace}'); - cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagValueInputError"]`).should('not.be.visible') + cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagInputError"]`).should('not.be.visible') cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="addTagKeyConfBtn"]`).should('be.enabled') cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="userTagValueInput"]`).type('{backspace}FIrst'); - cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagValueInputError"]`).should('have.text', 'There is already an entry for this Org value.') + cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="tagInputError"]`).should('have.text', 'There is already an entry for this Org value.') cy.get(`[data-cy="expandedChild_${user1}"] [data-cy="addTagKeyConfBtn"]`).should('not.be.enabled') }) diff --git a/e2e-tests/cypress/e2e/catalog/import_skills_from_catalog_spec.js b/e2e-tests/cypress/e2e/catalog/import_skills_from_catalog_spec.js index 056f658cdb..2f18ebb34b 100644 --- a/e2e-tests/cypress/e2e/catalog/import_skills_from_catalog_spec.js +++ b/e2e-tests/cypress/e2e/catalog/import_skills_from_catalog_spec.js @@ -528,7 +528,7 @@ describe('Import skills from Catalog Tests', () => { .should('have.text', '0'); }); - it.skip('do not allow to cross-project deps for the catalog imported skills', () => { + it('do not allow to cross-project deps for the catalog imported skills', () => { cy.createSkill(1, 1, 1); cy.exportSkillToCatalog(1, 1, 1); @@ -545,7 +545,7 @@ describe('Import skills from Catalog Tests', () => { .should('not.exist'); // imported skill }); - it.skip('do not allow to use imported skills in a Global Badge', () => { + it('do not allow to use imported skills in a Global Badge', () => { cy.createSkill(1, 1, 1); cy.exportSkillToCatalog(1, 1, 1); @@ -575,7 +575,7 @@ describe('Import skills from Catalog Tests', () => { .should('not.exist'); // imported skill }); - it.skip('allow to add imported skills to a project badge', () => { + it('allow to add imported skills to a project badge', () => { cy.createSkill(1, 1, 1); cy.exportSkillToCatalog(1, 1, 1); @@ -601,7 +601,7 @@ describe('Import skills from Catalog Tests', () => { cy.get('[data-cy="skillsSelectionItem-proj2-skill2"]'); cy.get('[data-cy="skillsSelectionItem-proj2-skill1"]') .click(); // imported and finalized skill - cy.get('[data-cy="simpleSkillsTable"]') + cy.get('[data-cy="badgeSkillsTable"]') .contains('Very Great Skill 1'); // imported skill added to the badge }); @@ -1061,178 +1061,6 @@ describe('Import skills from Catalog Tests', () => { .should('not.exist'); }); - it.skip('clear removes selection of current page', () => { - // mix skill names since it's sorted by skillId - this will force different projects in the first page - cy.createSkill(1, 1, 1); - cy.createSkill(1, 1, 6); - cy.createSkill(1, 1, 7); - cy.createSkill(1, 1, 4); - cy.createSkill(1, 1, 5); - cy.createSkill(1, 1, 9); - cy.createSkill(1, 1, 66); - cy.createSkill(1, 1, 67); - - cy.createProject(2); - cy.createSubject(2, 1); - cy.createSkill(2, 1, 2); - cy.createSkill(2, 1, 3); - cy.createSkill(2, 1, 8); - - cy.exportSkillToCatalog(1, 1, 1); - cy.exportSkillToCatalog(1, 1, 6); - cy.exportSkillToCatalog(1, 1, 7); - cy.exportSkillToCatalog(1, 1, 4); - cy.exportSkillToCatalog(1, 1, 5); - cy.exportSkillToCatalog(1, 1, 9); - cy.exportSkillToCatalog(1, 1, 66); - cy.exportSkillToCatalog(1, 1, 67); - - cy.exportSkillToCatalog(2, 1, 2); // proj 2 - cy.exportSkillToCatalog(2, 1, 3); // proj 2 - cy.exportSkillToCatalog(2, 1, 8); // proj 2 - - cy.createProject(3); - cy.createSubject(3, 1); - - cy.intercept('/admin/projects/proj3/skills/catalog**') - .as('getCatalogSkills'); - - cy.visit('/administrator/projects/proj3/subjects/subj1'); - - cy.get('[data-cy="importFromCatalogBtn"]') - .click(); - cy.wait('@getCatalogSkills'); - - cy.get('[data-cy="importBtn"]') - .should('be.disabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '0'); - - cy.get('[data-cy="skillSelect_proj1-skill1"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill2"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill3"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill4"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill5"]') - .should('not.be.checked'); - - cy.get('[data-cy="selectPageOfSkillsBtn"]') - .click(); - - cy.get('[data-cy="skillSelect_proj1-skill1"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill2"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill3"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill4"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill5"]') - .should('be.checked'); - - cy.get('[data-cy="importBtn"]') - .should('be.enabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '5'); - cy.get('[aria-label="Go to page 2"') - .click(); - cy.wait('@getCatalogSkills'); - - cy.get('[data-cy="skillSelect_proj1-skill6"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill7"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill8"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill67"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill66"]') - .should('not.be.checked'); - cy.get('[data-cy="selectPageOfSkillsBtn"]') - .click(); - cy.get('[data-cy="importBtn"]') - .should('be.enabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '10'); - cy.get('[data-cy="skillSelect_proj1-skill6"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill7"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill8"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill67"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill66"]') - .should('be.checked'); - cy.get('[aria-label="Go to page 1"') - .click(); - cy.wait('@getCatalogSkills'); - cy.get('[data-cy="skillSelect_proj1-skill1"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill2"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill3"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill4"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill5"]') - .should('be.checked'); - - cy.get('[data-cy="clearSelectedBtn"]') - .click(); - cy.get('[data-cy="skillSelect_proj1-skill1"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill2"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill3"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill4"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill5"]') - .should('not.be.checked'); - cy.get('[data-cy="importBtn"]') - .should('be.enabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '5'); - - cy.get('[aria-label="Go to page 2"') - .click(); - cy.wait('@getCatalogSkills'); - cy.get('[data-cy="skillSelect_proj1-skill6"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill7"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill8"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill67"]') - .should('be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill66"]') - .should('be.checked'); - cy.get('[data-cy="importBtn"]') - .should('be.enabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '5'); - cy.get('[data-cy="clearSelectedBtn"]') - .click(); - cy.get('[data-cy="skillSelect_proj1-skill6"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill7"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj2-skill8"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill67"]') - .should('not.be.checked'); - cy.get('[data-cy="skillSelect_proj1-skill66"]') - .should('not.be.checked'); - cy.get('[data-cy="importBtn"]') - .should('be.disabled'); - cy.get('[data-cy="numSelectedSkills"]') - .should('have.text', '0'); - }); - it('respect maxSkillsPerSubject configuration', () => { // mix skill names since it's sorted by skillId - this will force different projects in the first page cy.intercept('GET', '/public/config', (req) => { diff --git a/e2e-tests/cypress/e2e/my-progress_breadcrumb_spec.js b/e2e-tests/cypress/e2e/my-progress_breadcrumb_spec.js index 6687cdf1be..8395f29c95 100644 --- a/e2e-tests/cypress/e2e/my-progress_breadcrumb_spec.js +++ b/e2e-tests/cypress/e2e/my-progress_breadcrumb_spec.js @@ -553,7 +553,7 @@ describe('My Progress Breadcrumb Tests', () => { .contains('Overall Points'); }); - it.skip('test breadcrumbs with custom labels', function () { + it('test breadcrumbs with custom labels', function () { // log in as project admin and set custom labels cy.fixture('vars.json') .then((vars) => { @@ -804,7 +804,7 @@ describe('My Progress Breadcrumb Tests', () => { .contains('Cross-Work Role Course'); // internal dependency - cy.visit('/progress-and-rankings/projects/proj1/subjects/subj1/skills/skill4/dependency/skill2'); + cy.visit('/progress-and-rankings/projects/proj1/subjects/subj1/skills/skill2'); cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-skill2]') .should('exist'); cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-skill2]') @@ -818,12 +818,12 @@ describe('My Progress Breadcrumb Tests', () => { cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-proj1]') .should('have.attr', 'href'); cy.get('[data-cy=breadcrumb-bar]') - .contains(new RegExp(/^Progress And Rankings.*Work Role:\s*proj1.*Competency:\s*subj1.*Course:\s*skill4.*Prerequisite:\s*skill2$/)) + .contains(new RegExp(/^Progress And Rankings.*Work Role:\s*proj1.*Competency:\s*subj1.*Course:\s*skill2.*$/)) .should('be.visible'); cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-item]') .its('length') - .should('eq', 5); + .should('eq', 4); cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-item]') .eq(0) .should('contain.text', 'Progress And Rankings'); @@ -835,9 +835,6 @@ describe('My Progress Breadcrumb Tests', () => { .should('contain.text', 'subj1'); cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-item]') .eq(3) - .should('contain.text', 'skill4'); - cy.get('[data-cy="breadcrumb-bar"] [data-cy=breadcrumb-item]') - .eq(4) .should('contain.text', 'skill2'); // Go to Badges page From d66c8c1bb10ca65e2daf05b5e06747b9ce6f4215 Mon Sep 17 00:00:00 2001 From: Don Walizer <12420708+dwalizer@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:02:13 -0400 Subject: [PATCH 2/2] #2490 Unskip a working test --- e2e-tests/cypress/e2e/catalog/various_catalog_featurse_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/cypress/e2e/catalog/various_catalog_featurse_spec.js b/e2e-tests/cypress/e2e/catalog/various_catalog_featurse_spec.js index f5fc5ef368..acccc0f48e 100644 --- a/e2e-tests/cypress/e2e/catalog/various_catalog_featurse_spec.js +++ b/e2e-tests/cypress/e2e/catalog/various_catalog_featurse_spec.js @@ -22,7 +22,7 @@ describe('Single Skill and Catalog Tests', () => { cy.createSubject(1, 1); }); - it.skip('show IMPORTED badge on performed skills table', () => { + it('show IMPORTED badge on performed skills table', () => { cy.createSkill(1, 1, 1); cy.createSkill(1, 1, 2); cy.createSkill(1, 1, 3);