Skip to content

Commit

Permalink
#2490 - configure video page - WIP
Browse files Browse the repository at this point in the history
rmmayo committed May 28, 2024
1 parent 04d292c commit 4213d0c
Showing 7 changed files with 21 additions and 17 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ const fallthroughAttributes = useSkillsInputFallthroughAttributes()

<template>
<div class="field text-left" v-bind="fallthroughAttributes.rootAttrs.value">
<label :for="name"><span v-if="isRequired">*</span> {{ label }} </label>
<label v-if="label" :for="name"><span v-if="isRequired">*</span> {{ label }} </label>
<InputText
class="w-full"
type="text"
6 changes: 3 additions & 3 deletions dashboard-prime/src/components/video/VideoConfigPage.vue
Original file line number Diff line number Diff line change
@@ -442,11 +442,11 @@ const { values, meta, handleSubmit, resetForm, validate, errors } = useForm({ va
<div data-cy="videoCaptionsInputFields">
<div class="flex mb-2">
<div class="flex-1 align-content-end">
<label for="videoCaptionsInput">Captions:</label>
<label for="videoCaptions">Captions:</label>
</div>
<div v-if="!videoConf.captions && !isReadOnly" class="flex">
<SkillsButton
data-cy="fillInCaptionsExampleBtn"
data-cy="fillCaptionsExamples"
size="small"
severity="info"
outlined
@@ -472,7 +472,7 @@ const { values, meta, handleSubmit, resetForm, validate, errors } = useForm({ va
<div data-cy="videoTranscriptInput">
<div class="flex mb-2">
<div class="flex-1 align-content-end">
<label for="videoTranscriptInput">Transcript:</label>
<label for="videoTranscript">Transcript:</label>
</div>
</div>
<SkillsTextarea
2 changes: 1 addition & 1 deletion dashboard-prime/src/components/video/VideoFileInput.vue
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ const openFileDialog = (event) => {
name="videoFileInput"
:disabled="true"/>
<SkillsButton
data-cy="showFileUploadBtn"
data-cy="resetBtn"
size="small"
style="height: 1%; padding: 0.8rem"
outlined
2 changes: 1 addition & 1 deletion e2e-tests/cypress/e2e/accessibility/accessibility_specs.js
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ describe('Accessibility Tests', () => {
cy.createProject(1);
cy.createSubject(1, 1);
cy.createSkill(1, 1, 1);
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1/configVideo');
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1/config-video');
cy.injectAxe();

cy.get('[data-cy="saveVideoSettingsBtn"]').should('be.disabled')
24 changes: 14 additions & 10 deletions e2e-tests/cypress/e2e/video/configure_video_spec.js
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ describe('Configure Video Tests', () => {
cy.intercept('GET', '/admin/projects/proj1/skills/skill1/video').as('getVideoProps')
cy.intercept('GET', '/admin/projects/proj1/subjects/subj1/skills/skill1').as('getSkillInfo')
Cypress.Commands.add("visitVideoConfPage", (projNum) => {
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1/configVideo');
cy.visit('/administrator/projects/proj1/subjects/subj1/skills/skill1/config-video');
cy.wait('@getVideoProps')
cy.wait('@getSkillInfo')
cy.get('.spinner-border').should('not.exist')
@@ -61,13 +61,15 @@ describe('Configure Video Tests', () => {
cy.get('[data-cy="saveVideoSettingsBtn"]').should('be.disabled')
cy.get('[data-cy="saveVideoSettingsBtn"]').should('be.disabled')
const videoFile = 'create-subject.webm';
cy.get('[data-cy="videoFileUpload"]').attachFile({ filePath: videoFile, encoding: 'binary'});
cy.fixture(videoFile, null).as('videoFile');
cy.get('[data-cy="videoFileUpload"] input[type=file]').selectFile('@videoFile', { force: true })
// cy.get('[data-cy="videoFileUpload"]').attachFile({ filePath: videoFile, encoding: 'binary'});
cy.get('[data-cy="videoCaptions"]').type('captions', {delay: 0})
cy.get('[data-cy="videoTranscript"]').type('transcript', {delay: 0})
cy.get('[data-cy="saveVideoSettingsBtn"]').click()
cy.get('[data-cy="savedMsg"]')

cy.get('[data-cy="videoUrl"]').should('have.value', videoFile)
cy.get('[data-cy="videoFileInput"] input[type=text]').should('have.value', videoFile)
cy.get('[data-cy="videoCaptions"]').should('have.value','captions')
cy.get('[data-cy="videoTranscript"]').should('have.value','transcript')
cy.get('[data-cy="videoPreviewCard"] [data-cy="videoTotalDuration"]').should('have.text', '7 seconds')
@@ -80,7 +82,7 @@ describe('Configure Video Tests', () => {

// refresh and re-validate
cy.visitVideoConfPage();
cy.get('[data-cy="videoUrl"]').should('have.value', videoFile)
cy.get('[data-cy="videoFileInput"] input[type=text]').should('have.value', videoFile)
cy.get('[data-cy="videoCaptions"]').should('have.value','captions')
cy.get('[data-cy="videoTranscript"]').should('have.value','transcript')
cy.get('[data-cy="saveVideoSettingsBtn"]').click()
@@ -109,7 +111,7 @@ describe('Configure Video Tests', () => {
cy.get('[data-cy="clearVideoSettingsBtn"]').should('be.enabled')

cy.get('[data-cy="clearVideoSettingsBtn"]').click()
cy.get('footer .btn-danger').contains('Yes, Do clear').click()
cy.get('.p-dialog-footer').contains('Yes, Do clear').click()

cy.get('[data-cy="showFileUploadBtn"]').should('not.exist')
cy.get('[data-cy="showExternalUrlBtn"]').should('be.visible')
@@ -180,11 +182,13 @@ describe('Configure Video Tests', () => {
// modify
cy.get('[data-cy="showFileUploadBtn"]').click();
const videoFile = 'create-subject.webm';
cy.get('[data-cy="videoFileUpload"]').attachFile({ filePath: videoFile, encoding: 'binary'});
cy.fixture(videoFile, null).as('videoFile');
cy.get('[data-cy="videoFileUpload"] input[type=file]').selectFile('@videoFile', { force: true })
// cy.get('[data-cy="videoFileUpload"]').attachFile({ filePath: videoFile, encoding: 'binary'});
cy.get('[data-cy="videoCaptions"]').type('captions', {delay: 0})
cy.get('[data-cy="videoTranscript"]').type('transcript', {delay: 0})

cy.get('[data-cy="videoUrl"]').should('have.value', videoFile)
cy.get('[data-cy="videoFileInput"] input[type=text]').should('have.value', videoFile)
cy.get('[data-cy="videoCaptions"]').should('have.value','captions')
cy.get('[data-cy="videoTranscript"]').should('have.value','transcript')
cy.get('[data-cy="saveVideoSettingsBtn"]').should('be.enabled')
@@ -199,15 +203,15 @@ describe('Configure Video Tests', () => {
cy.get('[data-cy="showFileUploadBtn"]').should('exist')
});

it('discard changes - Video uploaded, captions and transcript are configured', () => {
it.only('discard changes - Video uploaded, captions and transcript are configured', () => {
cy.createProject(1)
cy.createSubject(1, 1);
cy.createSkill(1, 1, 1)
const vid = { file: 'create-subject.webm', captions: 'cool caption', transcript: 'great' }
cy.saveVideoAttrs(1, 1, vid)
cy.visitVideoConfPage();

cy.get('[data-cy="videoUrl"]').should('have.value', vid.file)
cy.get('[data-cy="videoFileInput"] input[type=text]').should('have.value', vid.file)
cy.get('[data-cy="videoCaptions"]').should('have.value', vid.captions)
cy.get('[data-cy="videoTranscript"]').should('have.value', vid.transcript)

@@ -223,7 +227,7 @@ describe('Configure Video Tests', () => {

// discard changes
cy.get('[data-cy="discardChangesBtn"]').click()
cy.get('[data-cy="videoUrl"]').should('have.value', vid.file)
cy.get('[data-cy="videoFileInput"] input[type=text]').should('have.value', vid.file)
cy.get('[data-cy="videoCaptions"]').should('have.value', vid.captions)
cy.get('[data-cy="videoTranscript"]').should('have.value', vid.transcript)
cy.get('[data-cy="showExternalUrlBtn"]').should('exist')
2 changes: 1 addition & 1 deletion e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"cy:run:oauth": "TZ=UTC cypress run --browser chrome --env oauthMode=true --config video=true",
"cy:run:accessibility": "TZ=UTC cypress run --browser chrome --env enableLighthouse=true,enableAvgLighthouseScore=true --browser chrome --headless --spec \"cypress/e2e/accessibility/*.js\" --config video=true",
"cy:run:dev": "TZ=UTC cypress run --browser chrome --config baseUrl=http://localhost:5173 --env type=base",
"cy:run:dev:specificTest": "TZ=UTC cypress run --browser chrome --config baseUrl=http://localhost:5173 --spec \"cypress/e2e/client-display/client-display-theme-various-display-sizes_spec.js\" --env type=base",
"cy:run:dev:specificTest": "TZ=UTC cypress run --browser chrome --config baseUrl=http://localhost:5173 --spec \"cypress/e2e/video/configure_video_spec.js\" --env type=base",
"cy:run:dev:updateSnapshotForSpecificTests": "TZ=UTC cypress run --browser chrome --env type=base --config baseUrl=http://localhost:5173 --spec \"cypress/e2e/quiz/client-display_quiz_theme_spec.js,cypress/e2e/quiz/client-display_quiz_visual_spec.js\"",
"cy:run:dev:metrics": "TZ=UTC cypress run --browser chrome --spec \"cypress/e2e/metrics/projectMetrics_projects_spec.js,cypress/e2e/metrics/projectMetrics_subjects_spec.js,cypress/e2e/metrics/skillMetrics_spec.js,cypress/e2e/metrics/subjectMetrics_spec.js\"",
"cy:run:dev:updateMetricsSnapshots": "TZ=UTC cypress run --browser chrome --config baseUrl=http://localhost:5173 --env type=base --spec \"cypress/e2e/metrics/projectMetrics_projects_spec.js,cypress/e2e/metrics/projectMetrics_subjects_spec.js,cypress/e2e/metrics/skillMetrics_spec.js,cypress/e2e/metrics/subjectMetrics_spec.js\"",

0 comments on commit 4213d0c

Please sign in to comment.