Skip to content

Commit

Permalink
Merge branch 'main' into BC-8130-browser-connectivity-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
UzaeirKhan committed Dec 11, 2024
2 parents c7b461a + 22baea4 commit 70c302c
Show file tree
Hide file tree
Showing 12 changed files with 526 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ test-run-details.json
cypress/fixtures/test-run-details.json
env_variables/*.env.json
env_variables/*
!env_variables/template.env.json
!env_variables/devTemplate.env.json
!env_variables/stagingTemplate.env.json
175 changes: 175 additions & 0 deletions cypress/e2e/course/shareCtlTools.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
@unstable_test
Feature: Teacher can share a course

As a teacher I want to share a course with other teachers from the same school

@unstable_test
Scenario: Pre-condition: admin adds external tools to school and teacher sets up a course with ctl tools
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I click on administration in menu
When I navigate to new school admin page via sub menu
When I click on external tools panel
When I click the add external tool button
When I select the tool 'CY Test Tool Context Scope' from available tools
When I click on save external tool button
When I click the add external tool button
When I select the tool 'CY Test Tool Optional Protected Parameter' from available tools
When I click on save external tool button
When I click the add external tool button
When I select the tool 'CY Test Tool Protected Parameter' from available tools
When I click on save external tool button
Then I see the tool 'CY Test Tool Context Scope' in external tools table
Then I see the tool 'CY Test Tool Optional Protected Parameter' in external tools table
Then I see the tool 'CY Test Tool Protected Parameter' in external tools table

# Pre-condition: teacher creates a course and adds tools to the course
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to courses overview
When I click on FAB to create a new course depending on sub menu
When I enter the course title 'Cypress Test Course Share'
Then I see teacher 'Karl Herzog' is selected by default
When I click on button Next Steps after entering the course detail in section one
When I click on button Next Steps after selecting course participant details
Then I see the section three area as the finish page
When I click on button To Course Overview on the finish page
Then I see the course 'Cypress Test Course Share' on the course overview page
When I go to course 'Cypress Test Course Share'
Then I see course page 'Cypress Test Course Share'
When I click on the tools tab
Then I see the button to add a tool
# Pre-condition: teacher adds a tool with required parameter
When I click on the button to add a tool
Then I see the tool configuration page title
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Context Scope' from available tools
When I enter 'test' in required custom parameter field 'searchparam'
When I click on save external tool button
Then I see the tool 'CY Test Tool Context Scope' in the tool overview
# Pre-condition: teacher adds a tool with optional protected parameter
When I click on the button to add a tool
Then I see the tool configuration page title
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Optional Protected Parameter' from available tools
When I enter 'test' in required custom parameter field 'search'
When I enter 'protected' in optional custom parameter field 'protected'
When I click on save external tool button
Then I see the tool 'CY Test Tool Optional Protected Parameter' in the tool overview
# Pre-condition: teacher adds a tool with required protected parameter
When I click on the button to add a tool
Then I see the tool configuration page title
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Protected Parameter' from available tools
When I enter 'test' in required custom parameter field 'search'
When I select 'Ja' in required protected custom parameter selection
When I click on save external tool button
Then I see the tool 'CY Test Tool Protected Parameter' in the tool overview

# Pre-condition: teacher creates a board and adds tools
When I go to the tab contents in course detail page
When I click on FAB to create new content
When I click on the button FAB New Column Board
Then I see a dialog box for column board
Then I see in dialog box option for multi-column board
Then I see in dialog box option for single column board
When I choose multi-column board in the dialog box
Then I see the page Course Board details
Then I see the chip Draft in the course board
When I click on the button Add column in the course board
When I click on the page outside of the column
# Pre-condition: teacher adds a tool with required parameter
When I click on plus icon to add card in column
When I click on plus icon to add content into card
When I select external tools from the menu
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Context Scope' from available tools
When I enter 'test' in required custom parameter field 'searchparam'
When I click on save external tool button
Then I see an external tool element with tool 'CY Test Tool Context Scope'
# Pre-condition: teacher adds a tool with optional protected parameter
When I click on three dot menu in the card
When I select the option Edit in three dot menu on the card
When I click on plus icon to add content into card
When I select external tools from the menu
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Optional Protected Parameter' from available tools
When I enter 'test' in required custom parameter field 'search'
When I enter 'protected' in optional custom parameter field 'protected'
When I click on save external tool button
Then I see an external tool element with tool 'CY Test Tool Optional Protected Parameter'
# Pre-condition: teacher adds a tool with required parameter
When I click on three dot menu in the card
When I select the option Edit in three dot menu on the card
When I click on plus icon to add content into card
When I select external tools from the menu
When I click on the tool configuration selection
When I select the tool 'CY Test Tool Protected Parameter' from available tools
When I enter 'test' in required custom parameter field 'search'
When I select 'Ja' in required protected custom parameter selection
When I click on save external tool button
Then I see an external tool element with tool 'CY Test Tool Protected Parameter'

# Teacher shares the course with another teacher in the same school
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to courses overview
When I go to course 'Cypress Test Course Share'
Then I see course page 'Cypress Test Course Share'
When I click on share course button
Then I see the share course dialog box
Then I see the info text in the share course dialog
Then I see the school internal checkbox as checked
Then I see the expiry date checkbox as checked
When I click on the continue button in the share course dialog
Then I see the import share course url in the share course result dialog
Then I see the mail button in the share course result dialog
Then I see the copy link button in the share course result dialog
Then I see the mail QR-Code button in the share course result dialog
When I save the import share course url
# Switch teacher to import shared course
Given I am logged in as a 'teacher2_nbc' at 'nbc'
When I go to courses overview
When I visit the saved import url of the shared course
Then I see the import share course dialog
Then I see the import share course tools info
Then I see 'Cypress Test Course Share' in the course name field
When I enter 'Cypress Test Course Import' in the course name field
When I click on the import course button
When I go to course 'Cypress Test Course Import'
Then I see course page 'Cypress Test Course Import'
# Teacher sees marked tools in tools tab
When I click on the tools tab
Then I see the tool 'CY Test Tool Context Scope' in the tool overview
Then I see the tool 'CY Test Tool Optional Protected Parameter' in the tool overview
Then I see the tool 'CY Test Tool Optional Protected Parameter' is marked as incomplete operational
Then I see the tool 'CY Test Tool Protected Parameter' in the tool overview
Then I see the tool 'CY Test Tool Protected Parameter' is marked as incomplete
# Teacher sees marked tools in board
When I go to the tab contents in course detail page
When I click on card Course Board
Then I see an external tool element with tool 'CY Test Tool Context Scope'
Then I see an external tool element with tool 'CY Test Tool Optional Protected Parameter'
Then I see external tool element with tool 'CY Test Tool Optional Protected Parameter' is marked as incomplete operational
Then I see an external tool element with tool 'CY Test Tool Protected Parameter'
Then I see external tool element with tool 'CY Test Tool Protected Parameter' is marked as incomplete
# Post-condition: admin deletes courses
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I click on administration in menu
When I go to course administration page
When I click the delete button for course 'Cypress Test Course Share' in course table
Then I see the delete modal
When I click the confirmation button on the delete modal
When I click the delete button for course 'Cypress Test Course Import' in course table
Then I see the delete modal
When I click the confirmation button on the delete modal
Then I do not see course 'Cypress Test Course Share' in course table
Then I do not see course 'Cypress Test Course Import' in course table
# Post-condition: admin deletes external tools
When I click on administration in menu
When I navigate to new school admin page via sub menu
When I click on external tools panel
Then I see the external tools table
When I click on delete button of tool 'CY Test Tool Context Scope'
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool Optional Protected Parameter'
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool Protected Parameter'
When I confirm deletion on deletion dialog
5 changes: 5 additions & 0 deletions cypress/support/pages/course/pageCourses.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Courses {
static #delteDialogTitle = '[data-testid="dialog-title"]';
static #delteDialogContent = '[data-testid="delete-dialog-content"]';
static #confirmDeleteDialogButton = '[data-testid="dialog-confirm"]';
static #btnShareCourse = '[data-testid="room-menu-share"]';

selectTeacherFromTeacherField(userName) {
cy.get(Courses.#teacherFieldContainer).click();
Expand Down Expand Up @@ -1192,5 +1193,9 @@ class Courses {
cy.wrap({ toolName: "", isLaunched: false }).as("launchedTool");
}

clickShareCourseButton() {
cy.get(Courses.#dropDownCourse).parent().click();
cy.get(Courses.#btnShareCourse).click();
}
}
export default Courses;
57 changes: 57 additions & 0 deletions cypress/support/pages/course/pageImportCourseModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"use strict"

class ImportCourseModal {

static #importShareCourseDialog = '[data-testid="import-modal"]'
static #importShareCourseToolsInfo = '[data-testid="import-modal-external-tools-info"]'
static #importShareCourseNameInputDiv = '[data-testid="import-modal-name-input"]'
static #importShareCourseNameInputField = 'div[data-testid="import-modal-name-input"] input[class="v-field__input"]'
static #importShareCourseDialogConfirmButton = '[data-testid="dialog-confirm"]';
static #importShareCourseDialogTitle = '[data-testid="dialog-title"]';
static #importShareCourseDialogTableHeader = '[data-testid="import-options-table-header"]';
static #importShareCourseDialogPersonalData = '[data-testid="import-options-personal-data-text"]';
static #importShareCourseDialogFilesInfo = '[data-testid="import-modal-coursefiles-info"]';
static #importShareCourseDialogExternalToolsInfo = '[data-testid="import-modal-external-tools-protected-parameter-info"]';

seeImportShareCourseDialogBox() {
cy.get(ImportCourseModal.#importShareCourseDialog).should("be.visible");
}

seeImportShareCourseToolsInfo() {
cy.get(ImportCourseModal.#importShareCourseToolsInfo).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseDialogTitle).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseDialogTableHeader).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseDialogPersonalData).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseDialogFilesInfo).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseDialogExternalToolsInfo).should("be.visible");
}

enterCourseNameForImportCourse(input) {
cy.get(ImportCourseModal.#importShareCourseNameInputDiv).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseNameInputDiv).clear();
cy.get(ImportCourseModal.#importShareCourseNameInputDiv).type(input);
}

clickOnConfirmButtonInImportShareCourseDialog() {
cy.get(ImportCourseModal.#importShareCourseDialogConfirmButton).click();
}

visitSavedShareCourseUrl() {
cy.get("@importShareCourseUrl").then((url) => {
cy.visit(url)
});
}

seeDefaultCourseNameForImportCourse(defaultCourseName) {
cy.get(ImportCourseModal.#importShareCourseNameInputDiv).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseNameInputField).should("be.visible");
cy.get(ImportCourseModal.#importShareCourseNameInputField)
.invoke("attr", "value")
.then((value) => {
expect(value).to.equal(defaultCourseName);
});

}
}

export default ImportCourseModal;
83 changes: 83 additions & 0 deletions cypress/support/pages/course/pageShareCourseModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"use strict"

class ShareCourseModal {
static #shareCourseDialog = '[data-testid="share-dialog"]'
static #shareCourseDialogInfoTextTitle = '[data-testid="share-options-info-text"]';
static #shareCourseDialogInfoTextContainer = '[data-testid="share-options-table-header"]';
static #shareCourseDialogPersonalDataInfo = '[data-testid="share-options-personal-data-text"]';
static #shareCourseDialogExternalToolsInfo = '[data-testid="share-modal-external-tools-info"]';
static #shareCourseDialogToolProtectedParamsInfo = '[data-testid="share-modal-external-tools-protected-parameter-info"]';
static #shareCourseDialogFilesInfo = '[data-testid="share-modal-coursefiles-info"]';
static #shareCourseDialogSchoolInternalCheckBox = '[data-testid="isSchoolInternal"]';
static #shareCourseDialogExpiryDateCheckBox = '[data-testid="hasExpiryDate"]';
static #shareCourseResultUrlTextBox = '[data-testid="share-course-result-url"]';
static #dialogNextButton = '[data-testid="dialog-next"]';
static #shareCourseDialogMailButton = '[data-testid="shareMailAction"]';
static #shareCourseDialogCopyLinkButton = '[data-testid="copyAction"]';
static #shareCourseDialogQrCodeButton = '[data-testid="qrCodeAction"]';

seeShareCourseDialogBox() {
cy.get(ShareCourseModal.#shareCourseDialog).should("be.visible");
}

seeInfoTextInShareCourseDialog() {
cy.get(ShareCourseModal.#shareCourseDialogInfoTextTitle).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogInfoTextContainer).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogPersonalDataInfo).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogExternalToolsInfo).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogToolProtectedParamsInfo).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogFilesInfo).should("be.visible");
}

seeSchoolInternalCheckBoxAsChecked() {
cy.get(ShareCourseModal.#shareCourseDialogSchoolInternalCheckBox).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogSchoolInternalCheckBox)
.find('input[type="checkbox"]')
.should("be.checked");
}

seeExpiryDateCheckBoxAsChecked() {
cy.get(ShareCourseModal.#shareCourseDialogExpiryDateCheckBox).should("be.visible");
cy.get(ShareCourseModal.#shareCourseDialogSchoolInternalCheckBox)
.find('input[type="checkbox"]')
.should("be.checked");
}

uncheckSchoolInternalCheckBoxInShareCourseDialog() {
cy.get(ShareCourseModal.#shareCourseDialogSchoolInternalCheckBox)
.find('input[type="checkbox"]')
.uncheck();
}

clickContinueButtonInDialog() {
cy.get(ShareCourseModal.#dialogNextButton).click();
}

seeCopyUrlInShareCourseResultDialog() {
cy.get(ShareCourseModal.#shareCourseResultUrlTextBox).should("be.visible");
}

saveTheUrlInShareCourseResultDialog() {
cy.get(ShareCourseModal.#shareCourseResultUrlTextBox)
.find(".v-field__input")
.invoke("attr", "value")
.then((value) => {
cy.wrap(value).as("importShareCourseUrl");
});
}

seeMailButtonInShareCourseResultDialog() {
cy.get(ShareCourseModal.#shareCourseDialogMailButton).should("be.visible");
}

seeCopyLinkButtonInShareCourseResultDialog() {
cy.get(ShareCourseModal.#shareCourseDialogCopyLinkButton).should("be.visible");
}

seeQrCodeButtonInShareCourseResultDialog() {
cy.get(ShareCourseModal.#shareCourseDialogQrCodeButton).should("be.visible");
}

}

export default ShareCourseModal;
6 changes: 5 additions & 1 deletion cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Board {
static #mainPageArea = '[id="main-content"]';
static #editOptionThreeDot = '[data-testid="board-menu-action-edit"]';
static #threeDotMenuInColumn = '[data-testid="column-menu-btn-0"]';
static #threeDotMenuInCard = '[data-testid="card-menu-btn"]';
static #threeDotMenuInCard = '[data-testid="card-menu-btn-0-0"]';
static #threeDotMenuOnDeletedElement = '[data-testid="deleted-element-menu-btn"]';
static #deleteOptionThreeDot = '[data-testid="board-menu-action-delete"]';
static #confirmButtonInModal = '[data-testid="dialog-confirm"]';
Expand Down Expand Up @@ -370,5 +370,9 @@ class Board {
seeTextInTextFieldInCard(textContent){
cy.contains(textContent);
}

seeDeletedElement(name) {
cy.get(Board.#deletedElement).contains(name).should("be.visible");
}
}
export default Board;
Loading

0 comments on commit 70c302c

Please sign in to comment.