Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
BC-6643 - fixing selector for course search input field (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport authored Feb 23, 2024
1 parent 63fc3c8 commit 0e59301
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions page-objects/pages/coursePages/CRSSCourseListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ const waitHelpers = require('../../../runtime/helpers/waitHelpers');
const sharedHelpers = require('../../../runtime/helpers/sharedHelpers');
const navigationLeftPage = require('../NavigationLeftPage');
const generalCoursePage = require('./CRSSGeneralCoursePage');
const editCoursePage = require('./CRSSEditCopyCoursePage')
const editCoursePage = require('./CRSSEditCopyCoursePage');
const roomsOverview = require('../RoomsOverviewPage');
const courseDescription = '.ckcontent';
const courseDescriptionSel = '#courseDescription';
const courseHeader = '.sc-card-header';
const searchCourseFiled = '[data-testid="search-field"]';;
const searchCourseField = '[data-testid="search-field"] input, input[data-testid="search-field"]';
const courseWrapper = '.sc-card-wrapper';
const titleOfCourse = '.title';
const memberBtn = '.btn-member';
const importCourseBtn = '[data-testid="import-course-btn"]';
const createCourseBtn = '[data-testid="add-course-button"]';
const listOfMembersSel = '#member-modal-body > ol > li';
const popupMembers = ".member-modal.in[role='dialog']";
const closeMemberModalBtn = ".member-modal button.close";
const closeMemberModalBtn = '.member-modal button.close';

const courseColours = {
grey: 'background: #455B6A',
Expand Down Expand Up @@ -106,15 +106,15 @@ function getColourSelector(colourName) {
}

async function setCourseNameIntoSearchInputField(courseName) {
await waitHelpers.waitAndSetValue(searchCourseFiled, courseName);
await waitHelpers.waitAndSetValue(searchCourseField, courseName);
}

async function getCountOfDisplayedCoursesForSection(section) {
const elem = await getListOfCoursesInSection(section);
var numberOfDisplayedCourses = 0;
for (var i = 0; i < elem.length; i++) {
if ((await elem[i].isDisplayed()) == true) {
numberOfDisplayedCourses ++;
numberOfDisplayedCourses++;
}
}
return numberOfDisplayedCourses;
Expand Down Expand Up @@ -237,9 +237,9 @@ async function isCountOfCourseMembers(courseName, expectedCountOfCourseMembers,
}

async function isCourseDescription(courseName, expectedDescription) {
await roomsOverview.clickOnTheElementWithName(courseName)
await roomsOverview.clickOnTheElementWithName(courseName);
await generalCoursePage.clickEditCourse();
await editCoursePage.clickEditOptionButton()
await editCoursePage.clickEditOptionButton();
const descriptionElement = await sharedHelpers.getElement(courseDescriptionSel);
const actualDescription = await descriptionElement.getText();
const msg = 'Course with name: ' + courseName + ' has wrong description. \n';
Expand Down Expand Up @@ -292,7 +292,6 @@ async function isCourseVisible(courseName, section, expectedValue) {
const resultMsg = 'Actual list of courses: ' + (await getListOfCourseTitlesInSection(section));
const isCourseOnList = await isCourseOnListInSection(courseName, section);
expect(isCourseOnList, msg + resultMsg).to.equal(expectedValue);

}

module.exports = {
Expand Down

0 comments on commit 0e59301

Please sign in to comment.