-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2000 from NationalSecurityAgency/t#1999/ci_failures
T#1999/ci failures
- Loading branch information
Showing
6 changed files
with
143 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,12 +195,7 @@ describe('Metrics Tests - Skills', () => { | |
.contains(`This skill was last achieved on ${m.format('YYYY-MM-DD HH:mm')}`); | ||
}); | ||
|
||
it('number of users over time', { | ||
retries: { | ||
runMode: 0, | ||
openMode: 0 | ||
} | ||
}, () => { | ||
it('number of users over time', () => { | ||
cy | ||
.intercept('/admin/projects/proj1/metrics/numUserAchievedOverTimeChartBuilder**') | ||
.as('singleSkillCountsChartBuilder'); | ||
|
@@ -280,12 +275,7 @@ describe('Metrics Tests - Skills', () => { | |
.contains('This chart needs at least 2 days of user activity'); | ||
}); | ||
|
||
it('number of users over time - 1 day', { | ||
retries: { | ||
runMode: 0, | ||
openMode: 0 | ||
} | ||
}, () => { | ||
it('number of users over time - 1 day', () => { | ||
cy | ||
.intercept('/admin/projects/proj1/metrics/numUserAchievedOverTimeChartBuilder?skillId=skill1', | ||
{ | ||
|
@@ -664,87 +654,84 @@ describe('Metrics Tests - Skills', () => { | |
|
||
}); | ||
|
||
it('number of users by tag', { | ||
retries: { | ||
runMode: 0, | ||
openMode: 0 | ||
} | ||
}, () => { | ||
cy | ||
.intercept('/admin/projects/proj1/metrics/skillAchievementsByTagBuilder**') | ||
.as('skillAchievementsByTagBuilder'); | ||
if (!Cypress.env('oauthMode')) { | ||
it('number of users by tag', () => { | ||
cy | ||
.intercept('/admin/projects/proj1/metrics/skillAchievementsByTagBuilder**') | ||
.as('skillAchievementsByTagBuilder'); | ||
|
||
cy.request('POST', '/admin/projects/proj1/subjects/subj1', { | ||
projectId: 'proj1', | ||
subjectId: 'subj1', | ||
name: 'Interesting Subject 1', | ||
}); | ||
|
||
const numSkills = 1; | ||
for (let skillsCounter = 1; skillsCounter <= numSkills; skillsCounter += 1) { | ||
cy.request('POST', `/admin/projects/proj1/subjects/subj1/skills/skill${skillsCounter}`, { | ||
cy.request('POST', '/admin/projects/proj1/subjects/subj1', { | ||
projectId: 'proj1', | ||
subjectId: 'subj1', | ||
skillId: `skill${skillsCounter}`, | ||
name: `Very Great Skill # ${skillsCounter}`, | ||
pointIncrement: '1000', | ||
numPerformToCompletion: '2', | ||
name: 'Interesting Subject 1', | ||
}); | ||
} | ||
; | ||
|
||
const m = moment.utc('2020-09-02 11', 'YYYY-MM-DD HH'); | ||
const numDays = 6; | ||
const numSkills = 1; | ||
for (let skillsCounter = 1; skillsCounter <= numSkills; skillsCounter += 1) { | ||
cy.request('POST', `/admin/projects/proj1/subjects/subj1/skills/skill${skillsCounter}`, { | ||
projectId: 'proj1', | ||
subjectId: 'subj1', | ||
skillId: `skill${skillsCounter}`, | ||
name: `Very Great Skill # ${skillsCounter}`, | ||
pointIncrement: '1000', | ||
numPerformToCompletion: '2', | ||
}); | ||
} | ||
; | ||
|
||
cy.fixture('vars.json') | ||
.then((vars) => { | ||
cy.login(vars.rootUser, vars.defaultPass); | ||
}); | ||
const m = moment.utc('2020-09-02 11', 'YYYY-MM-DD HH'); | ||
const numDays = 6; | ||
|
||
// Add users who achieved the skill | ||
for (let dayCounter = 1; dayCounter <= numDays; dayCounter += 1) { | ||
for (let userCounter = 1; userCounter <= dayCounter; userCounter += 1) { | ||
const userId = `user-${userCounter}[email protected]`; | ||
cy.fixture('vars.json') | ||
.then((vars) => { | ||
cy.login(vars.rootUser, vars.defaultPass); | ||
}); | ||
|
||
cy.request('POST', `/api/projects/proj1/skills/skill1`, | ||
{ | ||
userId: userId, | ||
timestamp: m.clone() | ||
// Add users who achieved the skill | ||
for (let dayCounter = 1; dayCounter <= numDays; dayCounter += 1) { | ||
for (let userCounter = 1; userCounter <= dayCounter; userCounter += 1) { | ||
const userId = `user-${userCounter}[email protected]`; | ||
|
||
cy.request('POST', `/api/projects/proj1/skills/skill1`, | ||
{ | ||
userId: userId, | ||
timestamp: m.clone() | ||
.add(dayCounter, 'day') | ||
.format('x') | ||
}); | ||
}); | ||
|
||
cy.addUserTag(userId, 'tagA', ['ABCDE', 'DEFGH']); | ||
cy.addUserTag(userId, 'tagA', ['ABCDE', 'DEFGH']); | ||
} | ||
} | ||
} | ||
|
||
// Add users in progress | ||
for (let userCounter = numDays; userCounter <= 10; userCounter += 1) { | ||
const userId = `user-${userCounter}[email protected]`; | ||
// Add users in progress | ||
for (let userCounter = numDays; userCounter <= 10; userCounter += 1) { | ||
const userId = `user-${userCounter}[email protected]`; | ||
|
||
cy.request('POST', `/api/projects/proj1/skills/skill1`, | ||
{ | ||
userId: userId, | ||
timestamp: m.clone() | ||
cy.request('POST', `/api/projects/proj1/skills/skill1`, | ||
{ | ||
userId: userId, | ||
timestamp: m.clone() | ||
.add(1, 'day') | ||
.format('x') | ||
}); | ||
}); | ||
|
||
cy.addUserTag(userId, 'tagA', ['ABCDE', 'DEFGH']); | ||
} | ||
cy.addUserTag(userId, 'tagA', ['ABCDE', 'DEFGH']); | ||
} | ||
|
||
cy.logout(); | ||
cy.fixture('vars.json') | ||
.then((vars) => { | ||
cy.login(vars.defaultUser, vars.defaultPass); | ||
}); | ||
cy.logout(); | ||
cy.fixture('vars.json') | ||
.then((vars) => { | ||
cy.login(vars.defaultUser, vars.defaultPass); | ||
}); | ||
|
||
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1'); | ||
cy.wait('@getConfig'); | ||
cy.clickNav('Metrics'); | ||
cy.wait('@skillAchievementsByTagBuilder'); | ||
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1'); | ||
cy.wait('@getConfig'); | ||
cy.clickNav('Metrics'); | ||
cy.wait('@skillAchievementsByTagBuilder'); | ||
|
||
cy.wait(waitForSnap); | ||
cy.matchSnapshotImageForElement('[data-cy=numUsersByTag]'); | ||
}); | ||
cy.wait(waitForSnap); | ||
cy.matchSnapshotImageForElement('[data-cy=numUsersByTag]'); | ||
}); | ||
} | ||
}); |
Oops, something went wrong.