Files
EdGateAutomatedRegression/tests/ExACT_editItemAddConcept.js

8888 lines
340 KiB
JavaScript

import { Builder, By, Key, until } from 'selenium-webdriver';
import fs from 'fs';
import XLSX from 'xlsx';
import path from 'path';
const ExACT_editItemAddConcept = (req, res) => {
res.send('<h2>ExACT Automated Test Script: Align - Edit Content and Align Concept(ExACT_editItemAddConcept); Initiated</h2>');
(async function example() {
let driver = await new Builder().forBrowser('chrome').build();
let testStatus = 'Failed';
let workbook;
let worksheet;
const startTime = new Date().toISOString();
const steps = [
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php
{ description: 'Expand browser', action: async () => await driver.manage().window().maximize() },
//LOGIN
{ description: 'Enter username', action: async () => await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan') },
{ description: 'Enter password', action: async () => await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!') },
{ description: 'Click Login button', action: async () => await driver.findElement(By.css('.login')).click() },
{ description: 'Wait for login process to complete', action: async () => await driver.sleep(10000) },
//Wait for dashboard to load - Correlation Coverages View Details button
{
description: 'Wait for dashboard load to completely',
action: async () => {
return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false);
}
},
//Dashboard title
{
description: 'Validate dashboard title',
action: async () => {
const elementText = await driver.findElement(By.css('.e-heading')).getText();
if (elementText !== 'Correlation Dashboard') {
throw new Error(`Expected: "Correlation Dashboard"; Actual: "${elementText}"`);
}
console.log('Passed: Dashboard title matched as expected');
}
},
//Align icon color -gray
{
description: 'Validate Align icon color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.fb-align')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Align icon color matched as expected');
}
},
//NEXT ACTION - Navigate to Align page
{ description: 'Click Align navigation link', action: async () => await driver.findElement(By.linkText('Align')).click() },
//Wait for page to load - Correlation Coverages View Details button
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('h2')), 10000).catch(() => false);
}
},
//Browse page title
{
description: 'Validate Browse page title',
action: async () => {
const elementText = await driver.findElement(By.css('h2')).getText();
if (elementText !== 'Browse') {
throw new Error(`Expected: "Browse"; Actual: "${elementText}"`);
}
console.log('Passed: Browse page title matched as expected');
}
},
//Browse page title text color -dark blue
{
description: 'Validate Browse page title text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Browse page title text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse page title text color matched as expected');
}
},
//Browse page title text font
{
description: 'Validate Browse page title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Browse page title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse page title text font-size matched as expected');
}
},
//Content tab label (active)
{
description: 'Validate Content tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Content')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content tab label matched as expected');
}
},
//Content tab text color -white (active)
{
description: 'Validate Content tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Content tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content tab text color matched as expected');
}
},
//Content tab color -dark blue (active)
{
description: 'Validate Content tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Content tab color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content tab color matched as expected');
}
},
//Standards tab label (dimmed)
{
description: 'Validate Standards tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Standards')).getText();
if (elementText !== 'Standards') {
throw new Error(`Expected: "Standards"; Actual: "${elementText}"`);
}
console.log('Passed: Standards tab label matched as expected');
}
},
//Standards tab text color -gray (dimmed)
{
description: 'Validate Standards tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Standards tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Standards tab text color matched as expected');
}
},
//Standards tab color -white (dimmed)
{
description: 'Validate Standards tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Standards tab color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Standards tab color matched as expected');
}
},
//Concepts tab label (dimmed)
{
description: 'Validate Concepts tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Concepts')).getText();
if (elementText !== 'Concepts') {
throw new Error(`Expected: "Concepts"; Actual: "${elementText}"`);
}
console.log('Passed: Concepts tab label matched as expected');
}
},
//Concepts tab text color -white (dimmed)
{
description: 'Validate Concepts tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Concepts')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Concepts tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Concepts tab text color matched as expected');
}
},
//Concepts tab color -white (dimmed)
{
description: 'Validate Concepts tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Concepts')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Concepts tab color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Concepts tab color matched as expected');
}
},
//Available Content header
{
description: 'Validate Available Content header',
action: async () => {
const elementText = await driver.findElement(By.css('#content form > p')).getText();
if (elementText !== 'Available Content') {
throw new Error(`Expected: "Available Content"; Actual: "${elementText}"`);
}
console.log('Passed: Available Content header matched as expected');
}
},
//Available Content 1
{
description: 'Validate Available Content 1 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Demo - User Submitted Content')).getText();
if (elementText !== 'Demo - User Submitted Content') {
throw new Error(`Expected: "Demo - User Submitted Content"; Actual: "${elementText}"`);
}
console.log('Passed: Demo - User Submitted Content label matched as expected');
}
},
//Available Content 2
{
description: 'Validate Available Content 2 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Upload Demo')).getText();
if (elementText !== 'Upload Demo') {
throw new Error(`Expected: "Upload Demo"; Actual: "${elementText}"`);
}
console.log('Passed: Upload Demo label matched as expected');
}
},
//Available Content 3
{
description: 'Validate Available Content 3 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Exploring - Access')).getText();
if (elementText !== 'Exploring - Access') {
throw new Error(`Expected: "Exploring - Access"; Actual: "${elementText}"`);
}
console.log('Passed: Exploring - Access label matched as expected');
}
},
//Available Content 4
{
description: 'Validate Available Content 4 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Exploring - PowerPoint')).getText();
if (elementText !== 'Exploring - PowerPoint') {
throw new Error(`Expected: "Exploring - PowerPoint"; Actual: "${elementText}"`);
}
console.log('Passed: Exploring - PowerPoint label matched as expected');
}
},
//Available Content 5
{
description: 'Validate Available Content 5 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Exploring - Word')).getText();
if (elementText !== 'Exploring - Word') {
throw new Error(`Expected: "Exploring - Word"; Actual: "${elementText}"`);
}
console.log('Passed: Exploring - Word label matched as expected');
}
},
//Available Content 6
{
description: 'Validate Available Content 6 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Algebra - QA')).getText();
if (elementText !== 'Algebra - QA') {
throw new Error(`Expected: "Algebra - QA"; Actual: "${elementText}"`);
}
console.log('Passed: Algebra - QA label matched as expected');
}
},
//Available Content 7
{
description: 'Validate Available Content 7 label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Biology - QA')).getText();
if (elementText !== 'Biology - QA') {
throw new Error(`Expected: "Biology - QA"; Actual: "${elementText}"`);
}
console.log('Passed: Biology - QA label matched as expected');
}
},
//Available Content - Advanced Options
{
description: 'Validate Available Content - Advance Options label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Advanced Options')).getText();
if (elementText !== 'Advanced Options') {
throw new Error(`Expected: "Advanced Options"; Actual: "${elementText}"`);
}
console.log('Passed: Advanced Options label matched as expected');
}
},
//Advanced Options text color -green
{
description: 'Validate Advanced Options text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Advanced Options')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Advanced Options text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Advanced Options text color matched as expected');
}
},
//NEXT ACTION - Navigate to Align page
{ description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() },
//Wait page to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.well > b')), 10000).catch(() => false);
}
},
//FILTERS
//Filter Results title
{
description: 'Validate Filter Results title',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getText();
if (elementText !== 'Filter Results') {
throw new Error(`Expected: "Filter Results"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title matched as expected');
}
},
//Filter Results title font size
{
description: 'Validate Filter Results title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Filter Results title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title font size matched as expected');
}
},
//Content Set title
{
description: 'Validate Content Set title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getText();
if (elementText !== 'Content Set') {
throw new Error(`Expected: "Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title matched as expected');
}
},
//Content Set title font size
{
description: 'Validate Content Set title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Content Set title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title font size matched as expected');
}
},
//Biology - QA checkbox
{
description: 'Verify Biology - QA checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaorgobjectid873576067')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Biology - QA checkbox icon not found');
}
console.log('Passed: Biology - QA checkbox icon present');
}
},
//Biology - QA count
{
description: 'Validate Biology - QA count',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText();
if (elementText !== 'Biology - QA (1046)') {
throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`);
}
console.log('Passed: Biology - QA (1046) label matched as expected');
}
},
//Grade title
{
description: 'Validate Grade title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getText();
if (elementText !== 'Grade') {
throw new Error(`Expected: "Grade"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title matched as expected');
}
},
//Grade title font size
{
description: 'Validate Grade title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Grade title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title font size matched as expected');
}
},
//Grade: 9 checkbox
{
description: 'Verify Grade: 9 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades49')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 9 checkbox icon not found');
}
console.log('Passed: Grade 9 checkbox icon present');
}
},
//Grade: 9 label
{
description: 'Validate Grade: 9 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(4)')).getText();
if (elementText !== '9') {
throw new Error(`Expected: Grade: "9" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 9 label matched as expected');
}
},
//Grade: 10 checkbox
{
description: 'Verify Grade: 10 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades51')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 10 checkbox icon not found');
}
console.log('Passed: Grade 10 checkbox icon present');
}
},
//Grade: 10 label
{
description: 'Validate Grade: 10 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(7)')).getText();
if (elementText !== '10') {
throw new Error(`Expected: Grade: "10" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 10 label matched as expected');
}
},
//Grade: 11 checkbox
{
description: 'Verify Grade: 11 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades52')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 11 checkbox icon not found');
}
console.log('Passed: Grade 11 checkbox icon present');
}
},
//Grade: 11 label
{
description: 'Validate Grade: 11 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(10)')).getText();
if (elementText !== '11') {
throw new Error(`Expected: Grade: "11" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 11 label matched as expected');
}
},
//Grade: 12 checkbox
{
description: 'Verify Grade: 12 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades53')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 12 checkbox icon not found');
}
console.log('Passed: Grade 12 checkbox icon present');
}
},
//Grade: 12 label
{
description: 'Validate Grade: 12 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(13)')).getText();
if (elementText !== '12') {
throw new Error(`Expected: Grade: "12" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 12 label matched as expected');
}
},
//Grade: 8 checkbox
{
description: 'Verify Grade: 8 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades48')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 8 checkbox icon not found');
}
console.log('Passed: Grade 8 checkbox icon present');
}
},
//Grade: 8 label
{
description: 'Validate Grade: 8 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(16)')).getText();
if (elementText !== '8') {
throw new Error(`Expected: Grade: "8" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 8 label matched as expected');
}
},
//Grade: More>> label
{
description: 'Validate Grade: More label',
action: async () => {
const elementText = await driver.findElement(By.linkText('More>>')).getText();
if (elementText !== 'More>>') {
throw new Error(`Expected: Grade: "More>>" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade More>> label matched as expected');
}
},
//Subject title
{
description: 'Validate Subject title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getText();
if (elementText !== 'Subject') {
throw new Error(`Expected: "Subject"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title matched as expected');
}
},
//Subject title font size
{
description: 'Validate Subject title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Subject title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title font size matched as expected');
}
},
//Subject: Science checkbox
{
description: 'Verify Subject: Science checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsScience')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Science checkbox icon not found');
}
console.log('Passed: Subject Science checkbox icon present');
}
},
//Subject: Science label
{
description: 'Validate Subject: Science label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText();
if (elementText !== 'Science') {
throw new Error(`Expected: Subject: "Science" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Science label matched as expected');
}
},
//Subject: Mathematics checkbox
{
description: 'Verify Subject: Mathematics checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Mathematics checkbox icon not found');
}
console.log('Passed: Subject Mathematics checkbox icon present');
}
},
//Subject: Mathematics label
{
description: 'Validate Subject: Mathematics label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText();
if (elementText !== 'Mathematics') {
throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Mathematics label matched as expected');
}
},
//Subject: Language Arts checkbox
{
description: 'Verify Subject: Language Arts checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsLanguage\\ Arts')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Language Arts checkbox icon not found');
}
console.log('Passed: Subject Language Arts checkbox icon present');
}
},
//Subject: Language Arts label
{
description: 'Validate Subject: Language Arts label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText();
if (elementText !== 'Language Arts') {
throw new Error(`Expected: Subject: "Language Arts" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Language Arts label matched as expected');
}
},
//Subject: Social Studies checkbox
{
description: 'Verify Subject: Social Studies checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ Studies')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Social Studies checkbox icon not found');
}
console.log('Passed: Subject Social Studies checkbox icon present');
}
},
//Subject: Social Studies label
{
description: 'Validate Subject: Social Studies label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(13)')).getText();
if (elementText !== 'Social Studies') {
throw new Error(`Expected: Subject: "Social Studies" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Social Studies label matched as expected');
}
},
//Subject: Social and Emotional Learning checkbox
{
description: 'Verify Subject: Social and Emotional Learning checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ and\\ Emotional\\ Learning')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Social and Emotional Learning checkbox icon not found');
}
console.log('Passed: Subject Social and Emotional Learning checkbox icon present');
}
},
//Subject: Social and Emotional Learning label
{
description: 'Validate Subject: Social and Emotional Learning label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(16)')).getText();
if (elementText !== 'Social and Emotional Learning') {
throw new Error(`Expected: Subject: "Social and Emotional Learninge" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Social and Emotional Learning label matched as expected');
}
},
//Alignment Status title
{
description: 'Validate Alignment Status title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getText();
if (elementText !== 'Alignment Status') {
throw new Error(`Expected: "Alignment Status" title; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title matched as expected');
}
},
//Alignment Status title font size
{
description: 'Validate Alignment Status title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Alignment Status title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title font size matched as expected');
}
},
//Alignment Status: Not Aligned checkbox
{
description: 'Verify Alignment Status: Not Aligned checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusNot\\ Aligned')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Not Aligned checkbox icon not found');
}
console.log('Passed: Alignment Status Not Aligned checkbox icon present');
}
},
//Not Aligned label
{
description: 'Validate Not Aligned label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(4)')).getText();
if (elementText !== 'Not Aligned') {
throw new Error(`Expected: "Not Aligned"; Actual: "${elementText}"`);
}
console.log('Passed: Not Aligned label matched as expected');
}
},
//Alignment Status: ECS Alignment checkbox
{
description: 'Verify Alignment Status: ECS Alignment checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusECS\\ Alignment')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: ECS Alignment checkbox icon not found');
}
console.log('Passed: Alignment Status ECS Alignment checkbox icon present');
}
},
//ECS Alignment label
{
description: 'Validate ECS Alignment label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(7)')).getText();
if (elementText !== 'ECS Alignment') {
throw new Error(`Expected: "ECS Alignment"; Actual: "${elementText}"`);
}
console.log('Passed: ECS Alignment label matched as expected');
}
},
//Alignment Status: Pending checkbox
{
description: 'Verify Alignment Status: Pending checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusPending')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Pending checkbox icon not found');
}
console.log('Passed: Alignment Status Pending checkbox icon present');
}
},
//Pending label
{
description: 'Validate Pending label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(10)')).getText();
if (elementText !== 'Pending') {
throw new Error(`Expected: "Pending"; Actual: "${elementText}"`);
}
console.log('Passed: Pending label matched as expected');
}
},
//Alignment Status: Aligned checkbox
{
description: 'Verify Alignment Status: Aligned checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusAligned')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Aligned checkbox icon not found');
}
console.log('Passed: Alignment Status Aligned checkbox icon present');
}
},
//Aligned label
{
description: 'Validate Aligned label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(13)')).getText();
if (elementText !== 'Aligned') {
throw new Error(`Expected: "Aligned"; Actual: "${elementText}"`);
}
console.log('Passed: Aligned label matched as expected');
}
},
//Reset All label
{
description: 'Validate Reset All label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Reset All')).getText();
if (elementText !== 'Reset All') {
throw new Error(`Expected: Grade: "Reset All" label; Actual: "${elementText}"`);
}
console.log('Passed: Reset All label matched as expected');
}
},
//Home breadcrumb link
{
description: 'Validate Home link',
action: async () => {
const elementText = await driver.findElement(By.linkText('Home')).getText();
if (elementText !== 'Home') {
throw new Error(`Expected: "Home"; Actual: "${elementText}"`);
}
console.log('Passed: Home link matched as expected');
}
},
//Content breadcrumb
{
description: 'Validate Content breadcrumb',
action: async () => {
const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content link matched as expected');
}
},
//Content breadcrumb text color -green
{
description: 'Validate Content breadcrumb text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content breadcrumb text color matched as expected');
}
},
//CONTENT RESULTS - PAGINATION ROW
//Detail View button
{
description: 'Validate Detail View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Detail View')).getText();
if (elementText !== 'Detail View') {
throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Detail View button text matched as expected');
}
},
//Detail View button color -green
{
description: 'Validate Detail View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Detail View button color matched as expected');
}
},
//Edit View button
{
description: 'Validate Edit View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Edit View')).getText();
if (elementText !== 'Edit View') {
throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Edit View button text matched as expected');
}
},
//Edit View button color -green
{
description: 'Validate Edit View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color');
if (elementStyle !== 'rgba(248, 249, 250, 1)') {
throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit View button color matched as expected');
}
},
//Save icon
{
description: 'Verify Save icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.float-right > a:nth-child(1) > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save icon not found');
}
console.log('Passed: Save icon present');
}
},
//Save icon tool-tip
{
description: 'Validate Save icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > div > div.col-xs-12.col-sm-9 > div.float-right.ml-1 > a:nth-child(1)')).getAttribute('title');
if (elementStyle !== 'Save This Search') {
throw new Error(`Expected: "Save This Search"; Actual: "${elementStyle}"`);
}
console.log('Passed: Save This Search tool-tip matched as expected');
}
},
//Print icon
{
description: 'Verify Print icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.icon-link > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Print icon not found');
}
console.log('Passed: Print icon present');
}
},
//Printicon tool-tip
{
description: 'Validate Print icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('.icon-link > img')).getAttribute('title');
if (elementStyle !== 'Print This Page') {
throw new Error(`Expected: "Print This Page"; Actual: "${elementStyle}"`);
}
console.log('Passed: Print This Page tool-tip matched as expected');
}
},
//Filtered Results 1-25 of 1046 label (top)
{
description: 'Validate Filtered Results 1-25 of 1046 label',
action: async () => {
const elementText = await driver.findElement(By.css('.float-left:nth-child(5)')).getText();
if (elementText !== 'Results 1 - 25 of 1046') {
throw new Error(`Expected: Filtered "Results 1 - 25 of 1046" label; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Results 1 - 25 of 1046 label matched as expected');
}
},
//PAGINATION BUTTONS
//Show button text
{
description: 'Validate Show button text',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) #contentlimit')).getText();
if (elementText !== 'Show') {
throw new Error(`Expected: "Show" button text; Actual: "${elementText}"`);
}
console.log('Passed: Show button text matched as expected');
}
},
//Show dropdown [should be: "25", option]
{
description: 'Validate Show dropdown option',
action: async () => {
const elementOption = await driver.findElement(By.css('.form-group:nth-child(6) #inputlimit')).getAttribute('value');
if (elementOption !== '25') {
throw new Error(`Expected: "25"; Actual: "${elementOption}"`);
}
console.log('Passed: Show dropdown option matched as expected');
}
},
//Pagination 1 button text
{
description: 'Validate pagination 1 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('1')).getText();
if (elementText !== '1') {
throw new Error(`Expected: Pagination "1" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 1 button text matched as expected');
}
},
//Pagination 1 background color -green
{
description: 'Validate pagination 1 button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('1')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 1 button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 1 button color matched as expected');
}
},
//Pagination 2 button text
{
description: 'Validate pagination 2 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('2')).getText();
if (elementText !== '2') {
throw new Error(`Expected: Pagination "2" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 2 button text matched as expected');
}
},
//Pagination 2 text color -green
{
description: 'Validate pagination 2 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('2')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 2 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 2 text color matched as expected');
}
},
//Pagination 3 button text
{
description: 'Validate pagination 3 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('3')).getText();
if (elementText !== '3') {
throw new Error(`Expected: Pagination "3" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 3 button text matched as expected');
}
},
//Pagination 3 text color -green
{
description: 'Validate pagination 3 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('3')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 3 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 3 text color matched as expected');
}
},
//Pagination 4 button text
{
description: 'Validate pagination 4 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('4')).getText();
if (elementText !== '4') {
throw new Error(`Expected: Pagination "4" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 4 button text matched as expected');
}
},
//Pagination 4 text color -green
{
description: 'Validate pagination 4 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('4')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 4 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 4 text color matched as expected');
}
},
//Pagination 5 button text
{
description: 'Validate pagination 5 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('5')).getText();
if (elementText !== '5') {
throw new Error(`Expected: Pagination "5" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 5 button text matched as expected');
}
},
//Pagination 5 text color -green
{
description: 'Validate pagination 5 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('5')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 5 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 5 text color matched as expected');
}
},
//Pagination separator icon
{
description: 'Verify Pagination separator icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.linkText('...')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Pagination separator icon not found');
}
console.log('Passed: Pagination separator icon present');
}
},
//Pagination 42 button text
{
description: 'Validate pagination 42 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('42')).getText();
if (elementText !== '42') {
throw new Error(`Expected: Pagination "42" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 42 button text matched as expected');
}
},
//Pagination 42 text color -green
{
description: 'Validate pagination 42 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('42')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 42 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 42 text color matched as expected');
}
},
//Pagination Show All button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Show All')).getText();
if (elementText !== 'Show All') {
throw new Error(`Expected: Pagination "Show All" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination Show All button text matched as expected');
}
},
//Pagination Show All text color -green
{
description: 'Validate pagination Show All text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Show All')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination Show All text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination Show All text color matched as expected');
}
},
//CONTENT RESULTS - CONTENT ITEMS
//Content 1 Title
{
description: 'Validate Content 1 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('AAA My Test III')).getText();
if (elementText !== 'AAA My Test III') {
throw new Error(`Expected: Content 1 item "AAA My Test III" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 item AAA My Test III title matched as expected');
}
},
//Content 1 Title font size
{
description: 'Validate Content 1 item AAA My Test III title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AAA My Test III')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 item "AAA My Test III" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 item AAA My Test III title text font-size matched as expected');
}
},
//Content 1 edit icon
{
description: 'Verify Content 1 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 edit icon not found');
}
console.log('Passed: Content 1 edit icon present');
}
},
//Content 1 edit button text
{
description: 'Validate Content 1 edit button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 1 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 Edit button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 description
{
description: 'Validate Content 1 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText();
if (elementText !== 'Yes, it should work! Perhaps') {
throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 description text matched as expected');
}
},
//Content 1 content set label
{
description: 'Validate Content 1 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 1 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 content set label matched as expected');
}
},
//Content 1 View Details button text
{
description: 'Validate Content 1 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 1 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Details button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 alignment label
{
description: 'Validate Content 1 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 > .display-alignment')).getText();
if (elementText !== 'Aligned (reset)') {
throw new Error(`Expected: Content 1 ECS Alignement label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement label matched as expected');
}
},
//Content 1 alignment reset label
{
description: 'Validate Content 1 ECS Alignement reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 1 ECS Alignement reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label matched as expected');
}
},
//Content 1 alignment reset label font size
{
description: 'Validate Content 1 ECS Alignement reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink874454004 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 ECS Alignement reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label text font-size matched as expected');
}
},
//Content 1 view standards button icon
{
description: 'Verify Content 1 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 View Standards button icon not found');
}
console.log('Passed: Content 1 View Standards button icon present');
}
},
//Content 1 view standards button text
{
description: 'Validate Content 1 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 1 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Standards button text matched as expected');
}
},
//Content 1 view standards button color -green
{
description: 'Validate Content 1 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 View Standards button color matched as expected');
}
},
//Content 2 Title
{
description: 'Validate Content 2 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText();
if (elementText !== 'Abrupt Climate Change') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title matched as expected');
}
},
//Content 2 Title font size
{
description: 'Validate Content 2 item Abrupt Climate Change title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Abrupt Climate Change')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title text font-size matched as expected');
}
},
//Content 2 edit icon
{
description: 'Verify Content 2 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 edit icon not found');
}
console.log('Passed: Content 2 edit icon present');
}
},
//Content 2 edit button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 2 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Edit button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 description
{
description: 'Validate Content 2 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText();
if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') {
throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 description text matched as expected');
}
},
//Content 2 content set label
{
description: 'Validate Content 2 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 2 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 content set label matched as expected');
}
},
//Content 2 View Details button text
{
description: 'Validate Content 2 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 2 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Details button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 alignment label
{
description: 'Validate Content 2 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 > .display-alignment')).getText();
if (elementText !== 'Alignment Pending (reset)') {
throw new Error(`Expected: Content 2 Alignement Pending label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Alignement Pending label matched as expected');
}
},
//Content 2 Alignment Pending reset label
{
description: 'Validate Content 2 Alignement Pending reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 2 Alignement Pending reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Alignement Pending reset label matched as expected');
}
},
//Content 2 Alignment Pending reset label font size
{
description: 'Validate Content 2 Alignment Pending reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink873578650 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 Alignment Pending reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Alignment Pending reset label text font-size matched as expected');
}
},
//Content 2 view standards button icon
{
description: 'Verify Content 2 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 View Standards button icon not found');
}
console.log('Passed: Content 2 View Standards button icon present');
}
},
//Content 2 view standards button text
{
description: 'Validate Content 2 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 2 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Standards button text matched as expected');
}
},
//Content 2 view standards button color -green
{
description: 'Validate Content 2 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 View Standards button color matched as expected');
}
},
//NEXT ACTION - Click view details button
{ description: 'Click Content 1 View Detials button', action: async () => await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//Content 1 view details text
{
description: 'Validate Content 1 View Details text',
action: async () => {
const elementText = await driver.findElement(By.css('#content874454004')).getText();
if (elementText !== 'Alignment Status: Aligned') {
throw new Error(`Expected: Content 1 View Details "Alignment Status: Aligned" text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Details text matched as expected');
}
},
//Content 1 view details text color -gray
{
description: 'Validate Content 1 view details text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#content874454004')).getCssValue('color');
if (elementStyle !== 'rgba(85, 85, 85, 1)') {
throw new Error(`Expected: Content 1 View Details text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 View Details text color matched as expected');
}
},
//NEXT ACTION - Apply pending filter
{ description: 'Apply Pending filter', action: async () => await driver.findElement(By.css('#metaAlignmentStatusPending')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//FILTERS
//Filter Results title
{
description: 'Validate Filter Results title',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getText();
if (elementText !== 'Filter Results') {
throw new Error(`Expected: "Filter Results"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title matched as expected');
}
},
//Filter Results title font size
{
description: 'Validate Filter Results title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Filter Results title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title font size matched as expected');
}
},
//Content Set title
{
description: 'Validate Content Set title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getText();
if (elementText !== 'Content Set') {
throw new Error(`Expected: "Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title matched as expected');
}
},
//Content Set title font size
{
description: 'Validate Content Set title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Content Set title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title font size matched as expected');
}
},
//Biology - QA checkbox
{
description: 'Verify Biology - QA checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaorgobjectid873576067')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Biology - QA checkbox icon not found');
}
console.log('Passed: Biology - QA checkbox icon present');
}
},
//Biology - QA count
{
description: 'Validate Biology - QA count',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText();
if (elementText !== 'Biology - QA (1046)') {
throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`);
}
console.log('Passed: Biology - QA (1046) label matched as expected');
}
},
//Grade title
{
description: 'Validate Grade title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getText();
if (elementText !== 'Grade') {
throw new Error(`Expected: "Grade"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title matched as expected');
}
},
//Grade title font size
{
description: 'Validate Grade title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Grade title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title font size matched as expected');
}
},
//Grade: 9 checkbox
{
description: 'Verify Grade: 9 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades49')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 9 checkbox icon not found');
}
console.log('Passed: Grade 9 checkbox icon present');
}
},
//Grade: 9 label
{
description: 'Validate Grade: 9 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(4)')).getText();
if (elementText !== '9') {
throw new Error(`Expected: Grade: "9" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 9 label matched as expected');
}
},
//Grade: 10 checkbox
{
description: 'Verify Grade: 10 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades51')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 10 checkbox icon not found');
}
console.log('Passed: Grade 10 checkbox icon present');
}
},
//Grade: 10 label
{
description: 'Validate Grade: 10 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(7)')).getText();
if (elementText !== '10') {
throw new Error(`Expected: Grade: "10" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 10 label matched as expected');
}
},
//Grade: 11 checkbox
{
description: 'Verify Grade: 11 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades52')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 11 checkbox icon not found');
}
console.log('Passed: Grade 11 checkbox icon present');
}
},
//Grade: 11 label
{
description: 'Validate Grade: 11 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(10)')).getText();
if (elementText !== '11') {
throw new Error(`Expected: Grade: "11" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 11 label matched as expected');
}
},
//Grade: 12 checkbox
{
description: 'Verify Grade: 12 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades53')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 12 checkbox icon not found');
}
console.log('Passed: Grade 12 checkbox icon present');
}
},
//Grade: 12 label
{
description: 'Validate Grade: 12 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(13)')).getText();
if (elementText !== '12') {
throw new Error(`Expected: Grade: "12" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 12 label matched as expected');
}
},
//Grade: 6 checkbox
{
description: 'Verify Grade: 6 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades45')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 6 checkbox icon not found');
}
console.log('Passed: Grade 6 checkbox icon present');
}
},
//Grade: 6 label
{
description: 'Validate Grade: 6 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(16)')).getText();
if (elementText !== '6') {
throw new Error(`Expected: Grade: "6" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 6 label matched as expected');
}
},
//Grade: More>> label
{
description: 'Validate Grade: More label',
action: async () => {
const elementText = await driver.findElement(By.linkText('More>>')).getText();
if (elementText !== 'More>>') {
throw new Error(`Expected: Grade: "More>>" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade More>> label matched as expected');
}
},
//Subject title
{
description: 'Validate Subject title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getText();
if (elementText !== 'Subject') {
throw new Error(`Expected: "Subject"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title matched as expected');
}
},
//Subject title font size
{
description: 'Validate Subject title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Subject title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title font size matched as expected');
}
},
//Subject: Science checkbox
{
description: 'Verify Subject: Science checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsScience')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Science checkbox icon not found');
}
console.log('Passed: Subject Science checkbox icon present');
}
},
//Subject: Science label
{
description: 'Validate Subject: Science label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText();
if (elementText !== 'Science') {
throw new Error(`Expected: Subject: "Science" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Science label matched as expected');
}
},
//Alignment Status title
{
description: 'Validate Alignment Status title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getText();
if (elementText !== 'Alignment Status') {
throw new Error(`Expected: "Alignment Status" title; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title matched as expected');
}
},
//Alignment Status title font size
{
description: 'Validate Alignment Status title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Alignment Status title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title font size matched as expected');
}
},
//Alignment Status Clear label
{
description: 'Validate Alignment Status Clear label',
action: async () => {
const elementText = await driver.findElement(By.css('small > a')).getText();
if (elementText !== 'Clear') {
throw new Error(`Expected: Alignment Status: "Clear" label; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status Clear label matched as expected');
}
},
//Alignment Status See All>> label
{
description: 'Validate Alignment Status See All label',
action: async () => {
const elementText = await driver.findElement(By.linkText('See All>>')).getText();
if (elementText !== 'See All>>') {
throw new Error(`Expected: Alignment Status: "See All>>" label; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status See All>> label matched as expected');
}
},
//Alignment Status: Pending checkbox -active
{
description: 'Validate Alignment Status: Pending checkbox option enabled',
action: async () => {
const elementStyle = await driver.findElement(By.css('#metaAlignmentStatusPending')).getAttribute('checked');
if (elementStyle !== 'true') {
throw new Error(`Alignment Status: Pending checkbox option value checked did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Alignment Status: Pending checkbox option value matched as expected');
}
},
//Pending label
{
description: 'Validate Pending label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(6)')).getText();
if (elementText !== 'Pending') {
throw new Error(`Expected: "Pending"; Actual: "${elementText}"`);
}
console.log('Passed: Pending label matched as expected');
}
},
//Alignment Status See All>> label
{
description: 'Validate Alignment Status See All label',
action: async () => {
const elementText = await driver.findElement(By.linkText('See All>>')).getText();
if (elementText !== 'See All>>') {
throw new Error(`Expected: Alignment Status: "See All>>" label; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status See All>> label matched as expected');
}
},
//Reset All label
{
description: 'Validate Reset All label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Reset All')).getText();
if (elementText !== 'Reset All') {
throw new Error(`Expected: Grade: "Reset All" label; Actual: "${elementText}"`);
}
console.log('Passed: Reset All label matched as expected');
}
},
//Home breadcrumb link
{
description: 'Validate Home link',
action: async () => {
const elementText = await driver.findElement(By.linkText('Home')).getText();
if (elementText !== 'Home') {
throw new Error(`Expected: "Home"; Actual: "${elementText}"`);
}
console.log('Passed: Home link matched as expected');
}
},
//Content breadcrumb
{
description: 'Validate Content breadcrumb',
action: async () => {
const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content link matched as expected');
}
},
//Content breadcrumb text color -green
{
description: 'Validate Content breadcrumb text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content breadcrumb text color matched as expected');
}
},
//CONTENT RESULTS - PAGINATION ROW
//Detail View button
{
description: 'Validate Detail View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Detail View')).getText();
if (elementText !== 'Detail View') {
throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Detail View button text matched as expected');
}
},
//Detail View button color -green
{
description: 'Validate Detail View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Detail View button color matched as expected');
}
},
//Edit View button
{
description: 'Validate Edit View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Edit View')).getText();
if (elementText !== 'Edit View') {
throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Edit View button text matched as expected');
}
},
//Edit View button color -green
{
description: 'Validate Edit View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color');
if (elementStyle !== 'rgba(248, 249, 250, 1)') {
throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit View button color matched as expected');
}
},
//Save icon
{
description: 'Verify Save icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.float-right > a:nth-child(1) > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save icon not found');
}
console.log('Passed: Save icon present');
}
},
//Save icon tool-tip
{
description: 'Validate Save icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > div > div.col-xs-12.col-sm-9 > div.float-right.ml-1 > a:nth-child(1)')).getAttribute('title');
if (elementStyle !== 'Save This Search') {
throw new Error(`Expected: "Save This Search"; Actual: "${elementStyle}"`);
}
console.log('Passed: Save This Search tool-tip matched as expected');
}
},
//Print icon
{
description: 'Verify Print icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.icon-link > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Print icon not found');
}
console.log('Passed: Print icon present');
}
},
//Printicon tool-tip
{
description: 'Validate Print icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('.icon-link > img')).getAttribute('title');
if (elementStyle !== 'Print This Page') {
throw new Error(`Expected: "Print This Page"; Actual: "${elementStyle}"`);
}
console.log('Passed: Print This Page tool-tip matched as expected');
}
},
//Applied filter
//Alignment Status Pending filter button
{
description: 'Validate Alignment Status Pending filter button text',
action: async () => {
const elementText = await driver.findElement(By.css('.badge')).getText();
if (elementText !== 'Alignment Status: Pending') {
throw new Error(`Expected: "Alignment Status: Pending" text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status Pending text matched as expected');
}
},
//Alignment Status Pending filter button color -dark gray
{
description: 'Verify Alignment Status Pending filter buttion close icon color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(108, 117, 125, 1)') {
throw new Error(`Expected: Alignment Status: Pending button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Alignment Status Pending button color matched as expected');
}
},
//Alignment Status Pending button close icon color -red
{
description: 'Verify Alignment Status Pending filter buttion close icon color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.glyphicon')).getCssValue('color');
if (elementStyle !== 'rgba(255, 0, 0, 1)') {
throw new Error(`Expected: Alignment Status: Pending button close icon color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Alignment Status Pending button close icon color matched as expected');
}
},
//Filtered Results 1 - 4 of 4 label (filtered)
{
description: 'Validate Filtered Results 1-25 of 1046 label',
action: async () => {
const elementText = await driver.findElement(By.css('.float-left:nth-child(6)')).getText();
if (elementText !== 'Results 1 - 4 of 4') {
throw new Error(`Expected: Filtered "Results 1 - 4 of 4" label; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Results 1 - 4 of 4 label matched as expected');
}
},
//CONTENT RESULTS - CONTENT ITEMS
//Filtered Content 1 Title
{
description: 'Validate Content 1 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText();
if (elementText !== 'Abrupt Climate Change') {
throw new Error(`Expected: Filtered Content 1 item "Abrupt Climate Change" title; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 item Abrupt Climate Change tittle matched as expected');
}
},
//Filtered Content 1 edit icon
{
description: 'Verify Filtered Content 1 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(1) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Filtered Content 1 edit icon not found');
}
console.log('Passed: Filtered Content 1 edit icon present');
}
},
//Filtered Content 1 edit button text
{
description: 'Validate Filtered Content 1 edit button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(1) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Filtered Content 1 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 Edit button text matched as expected');
}
},
//Filtered Content 1 edit button color -green
{
description: 'Validate Filtered Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(1) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Filtered Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Filtered Content 1 Edit button color matched as expected');
}
},
//Filtered Content 1 description
{
description: 'Validate Filtered Content 1 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(1) .lo-descr')).getText();
if (elementText !== `This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.`) {
throw new Error(`Expected: Filtered Content 1 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 description text matched as expected');
}
},
//Filtered Content 1 content set label
{
description: 'Validate Filtered Content 1 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(1) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Filtered Content 1 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 content set label matched as expected');
}
},
//Filtered Content 1 alignment label
{
description: 'Validate Filtered Content 1 Alignment Pending label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 > .display-alignment')).getText();
if (elementText !== 'Alignment Pending (reset)') {
throw new Error(`Expected: Filtered Content 1 Alignment Pending (reset) label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 Alignment Pending (reset) label matched as expected');
}
},
//Filtered Content 1 alignment reset label
{
description: 'Validate Filtered Content 1 Alignment Pending reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Filtered Content 1 Alignment Pending reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 Alignment Pending reset label matched as expected');
}
},
//Filtered Content 1 alignment reset label font size
{
description: 'Validate Filtered Content 1 alignment reset label font size',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Filtered Content 1 alignment reset label font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 alignment reset label font size matched as expected');
}
},
//Filtered Content 1 view standards button icon
{
description: 'Verify Filtered Content 1 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(1) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Filtered Content 1 View Standards button icon not found');
}
console.log('Passed: Filtered Content 1 View Standards button icon present');
}
},
//Filtered Content 1 view standards button text
{
description: 'Validate Filtered Content 1 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(1) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Filtered Content 1 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 1 View Standards button text matched as expected');
}
},
//Filtered Content 1 view standards button color -green
{
description: 'Validate Filtered Content 1 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(1) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Filtered Content 1 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Filtered Content 1 View Standards button color matched as expected');
}
},
//Filtered Content 2 Title
{
description: 'Validate Filtered Content 2 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Acceleration')).getText();
if (elementText !== 'Acceleration') {
throw new Error(`Expected: Filtered Content 2 item "Acceleration" title; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 item Acceleration tittle matched as expected');
}
},
//Filtered Content 2 edit icon
{
description: 'Verify Content 2 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(2) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Filtered Content 2 edit icon not found');
}
console.log('Passed: Filtered Content 2 edit icon present');
}
},
//Filtered Content 2 edit button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(2) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Filtered Content 2 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 Edit button text matched as expected');
}
},
//Filtered Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(2) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Filtered Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Filtered Content 2 Edit button color matched as expected');
}
},
//Filtered Content 2 description
{
description: 'Validate Filtered Content 2 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(2) .lo-descr')).getText();
if (elementText !== 'An exploration of physics. Calculating the acceleration of a Porsche. This video with commentary focuses on the study of mechanics.') {
throw new Error(`Expected: Filtered Content 2 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 description text matched as expected');
}
},
//Filtered Content 2 content set label
{
description: 'Validate Filtered Content 2 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(2) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Filtered Content 2 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 content set label matched as expected');
}
},
//Filtered Content 2 alignment label
{
description: 'Validate Filtered Content 2 Alignment Pending label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578651 > .display-alignment')).getText();
if (elementText !== 'Alignment Pending (reset)') {
throw new Error(`Expected: Filtered Content 2 Alignment Pending (reset) label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 Alignment Pending (reset) label matched as expected');
}
},
//Filtered Content 2 alignment reset label
{
description: 'Validate Filtered Content 2 Alignment Pending reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578651 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Filtered Content 2 Alignment Pending reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 Alignment Pending reset label matched as expected');
}
},
//Filtered Content 2 alignment reset label font size
{
description: 'Validate Filtered Content 2 alignment reset label font size',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578651 b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Filtered Content 2 alignment reset label font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 alignment reset label font size matched as expected');
}
},
//Filtered Content 2 view standards button icon
{
description: 'Verify Filtered Content 2 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(2) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Filtered Content 2 View Standards button icon not found');
}
console.log('Passed: Filtered Content 2 View Standards button icon present');
}
},
//Filtered Content 2 view standards button text
{
description: 'Validate Filtered Content 2 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(2) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Filtered Content 2 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Content 2 View Standards button text matched as expected');
}
},
//Filtered Content 2 view standards button color -green
{
description: 'Validate Filtered Content 2 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(2) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Filtered Content 2 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Filtered Content 2 View Standards button color matched as expected');
}
},
//Filtered Results 1-4 of 4 label (bottom)
{
description: 'Validate Filtered Results 1-4 of 4 label',
action: async () => {
const elementText = await driver.findElement(By.css('.float-left:nth-child(10)')).getText();
if (elementText !== 'Results 1 - 4 of 4') {
throw new Error(`Expected: Filtered "Results 1 - 4 of 4" label; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Results 1 - 4 of 4 label matched as expected');
}
},
//NEXT ACTION - Click Filtered content 2 Edit button
{ description: 'Click filtered countent 2 Edit button', action: async () => await driver.findElement(By.css('.card:nth-child(1) .ml-3')).click() },
//Wait for page to load - Edit Item
{
description: 'Wait for page to load - Edit Item',
action: async () => {
return await driver.wait(until.elementLocated(By.css('#myModalLabel')), 10000).catch(() => false);
}
},
//Page title
{
description: 'Validate Page title',
action: async () => {
const elementText = await driver.findElement(By.css('#myModalLabel')).getText();
if (elementText !== 'Edit Item') {
throw new Error(`Expected: "Edit Item" page title did not match; Actual: "${elementText}"`);
}
console.log('Passed: Edit Item page title matched as expected');
}
},
//Page title color -navy blue
{
description: 'Validate Page title color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Edit Item" page title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title color matched as expected');
}
},
//Page title font size -32px
{
description: 'Validate Page title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Expected: "Edit Item" page title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title font size matched as expected');
}
},
//Resource tab
{
description: 'Validate edit item tab 1',
action: async () => {
const elementText = await driver.findElement(By.linkText('Resource')).getText();
if (elementText !== 'Resource') {
throw new Error(`Expected: "Resource" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Resource tab label matched as expected');
}
},
//Resource tab label color -navy blue
{
description: 'Validate edit item tab 1',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Resource')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Active "Resource" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Active Resource tab label color matched as expected');
}
},
//Metadata tab
{
description: 'Validate edit item tab 2',
action: async () => {
const elementText = await driver.findElement(By.linkText('Metadata')).getText();
if (elementText !== 'Metadata') {
throw new Error(`Expected: "Metadata" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Metadata tab label matched as expected');
}
},
//Metadata tab label color -gray (dimmed)
{
description: 'Validate edit item tab 2',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Metadata')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: Dimmed "Metadata" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Dimmed Metadata tab label color matched as expected');
}
},
//Concepts/Correlate tab
{
description: 'Validate edit item tab 3',
action: async () => {
const elementText = await driver.findElement(By.linkText('Concepts/Correlate')).getText();
if (elementText !== 'Concepts/Correlate') {
throw new Error(`Expected: "Concepts/Correlate" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Concepts/Correlate tab label matched as expected');
}
},
//Concepts/Correlate tab label color -gray (dimmed)
{
description: 'Validate edit item tab 3',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Concepts/Correlate')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: Dimmed "Concepts/Correlate" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Dimmed Concepts/Correlate tab label color matched as expected');
}
},
//Edit item Save button icon
{
description: 'Verify Edit item Save button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.glyphicon-save')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save button icon not found');
}
console.log('Passed: Save button icon present');
}
},
//Edit item Save button
{
description: 'Validate Save button text',
action: async () => {
const elementText = await driver.findElement(By.css('.submit-content-button')).getText();
if (elementText !== 'Save Changes') {
throw new Error(`Expected: "Save Changes" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Save Changes button text matched as expected');
}
},
//Edit item Save button -green
{
description: 'Validate required label',
action: async () => {
const elementStyle = await driver.findElement(By.css('.submit-content-button')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Expected: "Save" button text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Save button text color matched as expected');
}
},
//Edit item required label
{
description: 'Validate Required label',
action: async () => {
const elementText = await driver.findElement(By.css('#tabsr-1 > div:nth-child(1)')).getText();
if (elementText !== '* Required') {
throw new Error(`Expected: "* Required" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: * Required label matched as expected');
}
},
//Edit item required label -red
{
description: 'Validate Required label text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#tabsr-1 > div:nth-child(1)')).getCssValue('color');
if (elementStyle !== 'rgba(255, 0, 0, 1)') {
throw new Error(`Expected: "Required" label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Required label color matched as expected');
}
},
//Edit item title label
{
description: 'Validate title label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label')).getText();
if (elementText !== '* Title') {
throw new Error(`Expected: "* Title" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: * Title label matched as expected');
}
},
//Edit item title textbox value
{
description: 'Validate Title text value',
action: async () => {
const elementValue = await driver.findElement(By.css('#cutitle')).getAttribute('value');
if (elementValue !== 'Abrupt Climate Change') {
throw new Error(`Expected: "Abrupt Climate Change"; Actual: "${elementValue}"`);
}
console.log('Passed: Abrupt Climate Change text value matched as expected');
}
},
//Edit item description label
{
description: 'Validate Description label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(4) > label')).getText();
if (elementText !== 'Description') {
throw new Error(`Expected: "Description" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Description label matched as expected');
}
},
//Edit item description textbox value
{
description: 'Validate Description text value',
action: async () => {
const elementValue = await driver.findElement(By.css('#cudesc')).getAttribute('value');
if (elementValue !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') {
throw new Error(`Expected: Description text value did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Description text value matched as expected');
}
},
//Edit item URL label
{
description: 'Validate URL label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getText();
if (elementText !== 'URL') {
throw new Error(`Expected: "URL" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: URL label matched as expected');
}
},
//Edit item URL textbox placeholder
{
description: 'Validate URL placeholder text',
action: async () => {
const elementValue = await driver.findElement(By.css('#cuurl')).getAttribute('value');
if (elementValue !== 'http://sciencenetlinks.com/lessons/abrupt-climate-change/') {
throw new Error(`Expected: URL text value; Actual: "${elementValue}"`);
}
console.log('Passed: URL text value matched as expected');
}
},
//Edit item Client Item ID label
{
description: 'Validate Client Item ID label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText();
if (elementText !== 'Client Item ID') {
throw new Error(`Expected: "Client Item ID" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Client Item ID label matched as expected');
}
},
//Edit item Client Item ID textbox value
{
description: 'Validate Client Item ID text value',
action: async () => {
const elementValue = await driver.findElement(By.css('#culoid')).getAttribute('value');
if (elementValue !== 'CMXSNLSC1311000003') {
throw new Error(`Expected: Client Item ID "CMXSNLSC1311000003"; Actual: "${elementValue}"`);
}
console.log('Passed: Client Item Id CMXSNLSC1311000003 text value matched as expected');
}
},
//Edit item Content Set label
{
description: 'Validate Content Set label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(7) > label')).getText();
if (elementText !== '* Content Set') {
throw new Error(`Expected: "* Content Set" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: *Content Set label matched as expected');
}
},
//Edit item Content Set textbox value (Biology - QA)
{
description: 'Validate Content Set text value',
action: async () => {
const elementValue = await driver.findElement(By.css('#orgs')).getAttribute('value');
if (elementValue !== '873576067') {
throw new Error(`Expected: "Biology - QA"; Actual: "${elementValue}"`);
}
console.log('Passed: Biology - QA text value matched as expected');
}
},
//Edit item Grades label
{
description: 'Validate Grades label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label')).getText();
if (elementText !== '* Grades') {
throw new Error(`Expected: "* Grades" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: * Grades label matched as expected');
}
},
//K grade checkbox
{
description: 'Verify K grade checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('38')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"K grade" checkbox icon not found');
}
console.log('Passed: K grade checkbox icon present');
}
},
//K grade label
{
description: 'Validate K grade label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(3) > .form-check-label')).getText();
if (elementText !== 'K') {
throw new Error(`Expected: "K grade"; Actual: "${elementText}"`);
}
console.log('Passed: K grade label matched as expected');
}
},
//Grade 1 checkbox
{
description: 'Verify grade 1 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('39')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 1" checkbox icon not found');
}
console.log('Passed: Grade 1 checkbox icon present');
}
},
//Grade 1 label
{
description: 'Validate grade 1 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(4) > .form-check-label')).getText();
if (elementText !== '1') {
throw new Error(`Expected: "Grade 1"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 1 label matched as expected');
}
},
//Grade 2 checkbox
{
description: 'Verify grade 2 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('40')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 2" checkbox icon not found');
}
console.log('Passed: Grade 2 checkbox icon present');
}
},
//Grade 2 label
{
description: 'Validate grade 2 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(5) > .form-check-label')).getText();
if (elementText !== '2') {
throw new Error(`Expected: "Grade 2"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 2 label matched as expected');
}
},
//Grade 3 checkbox
{
description: 'Verify grade 3 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('41')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 3" checkbox icon not found');
}
console.log('Passed: Grade 3 checkbox icon present');
}
},
//Grade 3 label
{
description: 'Validate grade 3 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(6) > .form-check-label')).getText();
if (elementText !== '3') {
throw new Error(`Expected: "Grade 3"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 3 label matched as expected');
}
},
//Grade 4 checkbox
{
description: 'Verify grade 4 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('43')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 4" checkbox icon not found');
}
console.log('Passed: Grade 4 checkbox icon present');
}
},
//Grade 4 label
{
description: 'Validate grade 4 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(7) > .form-check-label')).getText();
if (elementText !== '4') {
throw new Error(`Expected: "Grade 4"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 4 label matched as expected');
}
},
//Grade 5 checkbox
{
description: 'Verify grade 5 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('44')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 5" checkbox icon not found');
}
console.log('Passed: Grade 5 checkbox icon present');
}
},
//Grade 5 label
{
description: 'Validate grade 5 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(8) > .form-check-label')).getText();
if (elementText !== '5') {
throw new Error(`Expected: "Grade 5"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 5 label matched as expected');
}
},
//Grade 6 checkbox
{
description: 'Verify grade 6 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('45')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 6" checkbox icon not found');
}
console.log('Passed: Grade 6 checkbox icon present');
}
},
//Grade 6 label
{
description: 'Validate grade 6 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(9) > .form-check-label')).getText();
if (elementText !== '6') {
throw new Error(`Expected: "Grade 6"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 6 label matched as expected');
}
},
//Grade 7 checkbox
{
description: 'Verify grade 7 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('47')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 7" checkbox icon not found');
}
console.log('Passed: Grade 7 checkbox icon present');
}
},
//Grade 7 label
{
description: 'Validate grade 7 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(10) > .form-check-label')).getText();
if (elementText !== '7') {
throw new Error(`Expected: "Grade 7"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 7 label matched as expected');
}
},
//Grade 8 checkbox
{
description: 'Verify grade 8 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('48')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Grade 8" checkbox icon not found');
}
console.log('Passed: Grade 8 checkbox icon present');
}
},
//Grade 8 label
{
description: 'Validate grade 8 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(11) > .form-check-label')).getText();
if (elementText !== '8') {
throw new Error(`Expected: "Grade 8"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 8 label matched as expected');
}
},
//Grade 9 checkbox -enabled
{
description: 'Validate Grade 9 checkbox enabled',
action: async () => {
const elementStyle = await driver.findElement(By.id('49')).getAttribute('checked');
if (elementStyle !== 'true') {
throw new Error(`Grade 9 checked value did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Grade 9 checkbox enabled as expected');
}
},
//Grade 9 label
{
description: 'Validate grade 9 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(12) > .form-check-label')).getText();
if (elementText !== '9') {
throw new Error(`Expected: "Grade 9"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 9 label matched as expected');
}
},
//Grade 10 checkbox -enabled
{
description: 'Validate Grade 10 checkbox enabled',
action: async () => {
const elementStyle = await driver.findElement(By.id('51')).getAttribute('checked');
if (elementStyle !== 'true') {
throw new Error(`Grade 10 checked value did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Grade 10 checkbox enabled as expected');
}
},
//Grade 10 label
{
description: 'Validate grade 10 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(13) > .form-check-label')).getText();
if (elementText !== '10') {
throw new Error(`Expected: "Grade 10"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 10 label matched as expected');
}
},
//Grade 11 checkbox -enabled
{
description: 'Validate Grade 11 checkbox enabled',
action: async () => {
const elementStyle = await driver.findElement(By.id('52')).getAttribute('checked');
if (elementStyle !== 'true') {
throw new Error(`Grade 11 checked value did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Grade 11 checkbox enabled as expected');
}
},
//Grade 11 label
{
description: 'Validate grade 11 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(14) > .form-check-label')).getText();
if (elementText !== '11') {
throw new Error(`Expected: "Grade 11"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 11 label matched as expected');
}
},
//Grade 12 checkbox -enabled
{
description: 'Validate Grade 12 checkbox enabled',
action: async () => {
const elementStyle = await driver.findElement(By.id('53')).getAttribute('checked');
if (elementStyle !== 'true') {
throw new Error(`Grade 12 checked value did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Grade 12 checkbox enabled as expected');
}
},
//Grade 12 label
{
description: 'Validate grade 12 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-check:nth-child(15) > .form-check-label')).getText();
if (elementText !== '12') {
throw new Error(`Expected: "Grade 12"; Actual: "${elementText}"`);
}
console.log('Passed: Grade 12 label matched as expected');
}
},
//NEXT ACTION - Click Concepts/Correlate tab
{ description: 'Click Concepts-Correlate tab', action: async () => await driver.findElement(By.linkText('Concepts/Correlate')).click() },
//Wait for page to load - Edit Item
{
description: 'Wait for page to load - Edit Item',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.ui-widget-heading')), 10000).catch(() => false);
}
},
//Page title color -navy blue
{
description: 'Validate Page title color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Edit Item" page title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title color matched as expected');
}
},
//Page title font size -32px
{
description: 'Validate Page title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Expected: "Edit Item" page title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title font size matched as expected');
}
},
//Resource tab
{
description: 'Validate edit item tab 1',
action: async () => {
const elementText = await driver.findElement(By.linkText('Resource')).getText();
if (elementText !== 'Resource') {
throw new Error(`Expected: "Resource" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Resource tab label matched as expected');
}
},
//Resource tab label color -gray (dimmed)
{
description: 'Validate edit item tab 1',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Resource')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: Dimmed "Resource" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Dimmed Resource tab label color matched as expected');
}
},
//Metadata tab
{
description: 'Validate edit item tab 2',
action: async () => {
const elementText = await driver.findElement(By.linkText('Metadata')).getText();
if (elementText !== 'Metadata') {
throw new Error(`Expected: "Metadata" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Metadata tab label matched as expected');
}
},
//Metadata tab label color -gray (dimmed)
{
description: 'Validate edit item tab 2',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Metadata')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: Dimmed "Metadata" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Dimmed Metadata tab label color matched as expected');
}
},
//Concepts/Correlate tab
{
description: 'Validate edit item tab 3',
action: async () => {
const elementText = await driver.findElement(By.linkText('Concepts/Correlate')).getText();
if (elementText !== 'Concepts/Correlate') {
throw new Error(`Expected: "Concepts/Correlate" tab label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Concepts/Correlate tab label matched as expected');
}
},
//Concepts/Correlate tab label color -navy blue
{
description: 'Validate edit item tab 3',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Concepts/Correlate')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Active "Concepts/Correlate" tab label color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Active Concepts/Correlate tab label color matched as expected');
}
},
//Edit item Save button icon
{
description: 'Verify Edit item Save button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.glyphicon-save')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save button icon not found');
}
console.log('Passed: Save button icon present');
}
},
//Edit item Save button
{
description: 'Validate Save button text',
action: async () => {
const elementText = await driver.findElement(By.css('.submit-content-button')).getText();
if (elementText !== 'Save Changes') {
throw new Error(`Expected: "Save Changes" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Save Changes button text matched as expected');
}
},
//Edit item Save button -green
{
description: 'Validate required label',
action: async () => {
const elementStyle = await driver.findElement(By.css('.submit-content-button')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Expected: "Save" button text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Save button text color matched as expected');
}
},
//Tagged Concepts widget title
{
description: 'Validate Tagged Concepts widget title text',
action: async () => {
const elementText = await driver.findElement(By.css('.ui-widget-heading')).getText();
if (elementText !== 'Tagged Concepts:') {
throw new Error(`Expected: "Tagged Concepts:" widget title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concepts: widget title text matched as expected');
}
},
//Tagged Concepts widget title font size -16px
{
description: 'Validate Tagged Concepts widget title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('.ui-widget-heading')).getCssValue('font-size');
if (elementStyle !== '16px') {
throw new Error(`Expected: "Tagged Concepts:" widget title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concepts: widget title font size matched as expected');
}
},
//Tagged Concept 1 header text
{
description: 'Validate Tagged Concept 1 header text',
action: async () => {
const elementText = await driver.findElement(By.css('#k749')).getText();
if (elementText !== 'Science | Earth Science | Climate') {
throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 header text matched as expected');
}
},
//Tagged concept 1 header text color -gray
{
description: 'Validate Tagged concept 1 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 header text color matched as expected');
}
},
//Tagged Concept 1 remove button icon
{
description: 'Verify Tagged Concept remove button 1 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 1 Remove button icon present');
}
},
//Tagged Concept 1 remove button text
{
description: 'Validate Tagged Concept 1 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k749 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 Remove button text matched as expected');
}
},
//Tagged Concept 1 remove button color -red
{
description: 'Validate Tagged Concept 1 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove button color matched as expected');
}
},
//Tagged Concept 1 remove button -tooltip
{
description: 'Validate Tagged Concept 1 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 1 primary toggle button
{
description: 'Verify Tagged Concept 1 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 1 Primary toggle button icon present');
}
},
//Tagged Concept 2 header text
{
description: 'Validate Tagged Concept 2 header text',
action: async () => {
const elementText = await driver.findElement(By.css('#k937')).getText();
if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) {
throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 header text matched as expected');
}
},
//Tagged Concept 2 header text color -gray
{
description: 'Validate Tagged Concept 2 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 header text color matched as expected');
}
},
//Tagged Concept 2 remove button icon
{
description: 'Verify Tagged Concept remove button 2 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 2 Remove button icon present');
}
},
//Tagged Concept 2 remove button text
{
description: 'Validate Tagged Concept 2 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k937 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 Remove button text matched as expected');
}
},
//Tagged Concept 2 remove button color -red
{
description: 'Validate Tagged Concept 2 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove button color matched as expected');
}
},
//Tagged Concept 2 remove button -tooltip
{
description: 'Validate Tagged Concept 2 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 2 primary toggle button
{
description: 'Verify Tagged Concept 2 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 2 Primary toggle button icon present');
}
},
//Tagged Concept 3 header text
{
description: 'Validate Tagged Concept 3 header text',
action: async () => {
const elementText = await driver.findElement(By.css('#k37785095')).getText();
if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') {
throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 header text matched as expected');
}
},
//Tagged Concept 3 header text color -gray
{
description: 'Validate Tagged Concept 3 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 header text color matched as expected');
}
},
//Tagged Concept 3 remove button icon
{
description: 'Verify Tagged Concept remove button 3 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 3 Remove button icon present');
}
},
//Tagged Concept 3 remove button text
{
description: 'Validate Tagged Concept 3 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 Remove button text matched as expected');
}
},
//Tagged Concept 3 remove button color -red
{
description: 'Validate Tagged Concept 3 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove button color matched as expected');
}
},
//Tagged Concept 3 remove button -tooltip
{
description: 'Validate Tagged Concept 3 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 3 primary toggle button
{
description: 'Verify Tagged Concept 3 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 3 Primary toggle button icon present');
}
},
//Tagged Concept 4 header text
{
description: 'Validate Tagged Concept 4 header text',
action: async () => {
const elementText = await driver.findElement(By.css('#k425604099')).getText();
if (elementText !== 'Science | General') {
throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 header text matched as expected');
}
},
//Tagged Concept 4 header text color -gray
{
description: 'Validate Tagged Concept 4 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 header text color matched as expected');
}
},
//Tagged Concept 4 remove button icon
{
description: 'Verify Tagged Concept remove button 4 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 4 Remove button icon present');
}
},
//Tagged Concept 4 remove button text
{
description: 'Validate Tagged Concept 4 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 Remove button text matched as expected');
}
},
//Tagged Concept 4 remove button color -red
{
description: 'Validate Tagged Concept 4 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove button color matched as expected');
}
},
//Tagged Concept 4 remove button -tooltip
{
description: 'Validate Tagged Concept 4 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 4 primary toggle button
{
description: 'Verify Tagged Concept 4 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 4 Primary toggle button icon present');
}
},
//Find Concepts
//Find Concepts title text
{
description: 'Validate Find Concepts title text',
action: async () => {
const elementText = await driver.findElement(By.css('p')).getText();
if (elementText !== 'Find Concepts') {
throw new Error(`Expected: "Find Concepts" title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Find Concepts title text matched as expected');
}
},
//Browse tab title (active)
{
description: 'Validate browse tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Browse')).getText();
if (elementText !== 'Browse') {
throw new Error(`Expected: "Browse" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Browse tab title text matched as expected');
}
},
//Browse tab text title -white (active)
{
description: 'Validate browse tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Browse')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Expected: "Browse" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse tab text title color matched as expected');
}
},
//Browse tab title -navy blue (active)
{
description: 'Validate browse tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Browse')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Browse" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse tab title color matched as expected');
}
},
//By Standard tab title (dimmed)
{
description: 'Validate by standard tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('By Standard')).getText();
if (elementText !== 'By Standard') {
throw new Error(`Expected: "By Standard" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: By Standard tab title text matched as expected');
}
},
//By Standard tab text title -gray (dimmed)
{
description: 'Validate by standard tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('By Standard')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: "By Standard" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: By Standard tab text title color matched as expected');
}
},
//By Standard tab title -white (dimmed)
{
description: 'Validate by standard tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('By Standard')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Expected: "By Standard" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: By Standard tab title color matched as expected');
}
},
//AutoAlign tab title (dimmed)
{
description: 'Validate AutoAlign tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('AutoAlign')).getText();
if (elementText !== 'AutoAlign') {
throw new Error(`Expected: "AutoAlign" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: AutoAlign tab title text matched as expected');
}
},
//AutoAlign tab text title -gray (dimmed)
{
description: 'Validate AutoAlign tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AutoAlign')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: "AutoAlign" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: AutoAlign tab text title color matched as expected');
}
},
//AutoAlign tab title -white (dimmed)
{
description: 'Validate AutoAlign tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AutoAlign')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Expected: "AutoAlign" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: AutoAlign tab title color matched as expected');
}
},
//Browse the concept list and filter by term title
{
description: 'Validate Browse the concept list and filter by term title',
action: async () => {
const elementText = await driver.findElement(By.css('.mt-2 > h5')).getText();
if (elementText !== 'Browse the concept list and filter by term') {
throw new Error(`Expected: "Browse the concept list and filter by term" title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Browse the concept list and filter by term title text matched as expected');
}
},
//Browse the concept list and filter by term -navy blue
{
description: 'Validate Browse the concept list and filter by term title color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.mt-2 > h5')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Browse the concept list and filter by term" title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse the concept list and filter by term title color matched as expected');
}
},
//Browse the concept list and filter by term font size -20px
{
description: 'Validate Page title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('.mt-2 > h5')).getCssValue('font-size');
if (elementStyle !== '20px') {
throw new Error(`Expected: "Browse the concept list and filter by term" title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse the concept list and filter by term title font size matched as expected');
}
},
//Filter Concepts label
{
description: 'Validate Filter Concepts label',
action: async () => {
const elementText = await driver.findElement(By.css('.mr-1')).getText();
if (elementText !== 'Filter Concepts') {
throw new Error(`Expected: "Filter Concepts" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filter Concepts label text matched as expected');
}
},
//Filter Concepts textbox placeholder
{
description: 'Validate URL placeholder text',
action: async () => {
const elementValue = await driver.findElement(By.css('#q')).getAttribute('placeholder');
if (elementValue !== 'Enter Term...') {
throw new Error(`Expected: "Enter Term..."; Actual: "${elementValue}"`);
}
console.log('Passed: Enter Term... placeholder text matched as expected');
}
},
//Filter button text
{
description: 'Validate filter button text',
action: async () => {
const elementText = await driver.findElement(By.css('#qbutton')).getText();
if (elementText !== 'Filter') {
throw new Error(`Expected: "Filter" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Filter button text matched as expected');
}
},
//Filter button color -green
{
description: 'Validate filter button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#qbutton')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: "Filter" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Filter button color matched as expected');
}
},
//Language Arts label
{
description: 'Validate language arts label text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(1) > div:nth-child(3)')).getText();
if (elementText !== 'Language Arts') {
throw new Error(`Expected: "Language Arts" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Language Arts label text matched as expected');
}
},
//Language Arts button text
{
description: 'Validate language arts button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(1) > .badge')).getText();
if (elementText !== '1359') {
throw new Error(`Expected: "Language Arts" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Language Arts button text matched as expected');
}
},
//Language Arts button color -navy blue
{
description: 'Validate language arts button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.list-group-item:nth-child(1) > .badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Language Arts button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Language Arts button color matched as expected');
}
},
//Language Arts arrow icon
{
description: 'Verify language arts arrow icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) > .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Language Arts arrow icon not found');
}
console.log('Passed: Language Arts arrow icon present');
}
},
//Mathematics label
{
description: 'Validate mathematics label text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) > div:nth-child(3)')).getText();
if (elementText !== 'Mathematics') {
throw new Error(`Expected: "Mathematics" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Mathematics label text matched as expected');
}
},
//Mathematics button text
{
description: 'Validate mathematics button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) > .badge')).getText();
if (elementText !== '1219') {
throw new Error(`Expected: "Mathematics" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Mathematics button text matched as expected');
}
},
//Mathematics button color -navy blue
{
description: 'Validate mathematics button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.list-group-item:nth-child(2) > .badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Mathematics button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Mathematics button color matched as expected');
}
},
//Mathematics arrow icon
{
description: 'Verify mathematics arrow icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Mathematics arrow icon not found');
}
console.log('Passed: Mathematics arrow icon present');
}
},
//Science label
{
description: 'Validate science label text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > div:nth-child(3)')).getText();
if (elementText !== 'Science') {
throw new Error(`Expected: "Science" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Science label text matched as expected');
}
},
//Science button text
{
description: 'Validate science button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > .badge')).getText();
if (elementText !== '2108') {
throw new Error(`Expected: "Science" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Science button text matched as expected');
}
},
//Science button color -navy blue
{
description: 'Validate science button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.list-group-item:nth-child(3) > .badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Science button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Science button color matched as expected');
}
},
//Science arrow icon
{
description: 'Verify science arrow icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(3) > .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Science arrow icon not found');
}
console.log('Passed: Science arrow icon present');
}
},
//Social Studies label
{
description: 'Validate social studies label text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(4) > div:nth-child(3)')).getText();
if (elementText !== 'Social Studies') {
throw new Error(`Expected: "Social Studies" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Social Studies label text matched as expected');
}
},
//Social Studies label button text
{
description: 'Validate social studies button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(4) > .badge')).getText();
if (elementText !== '2188') {
throw new Error(`Expected: "Social Studies" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Social Studies button text matched as expected');
}
},
//Social Studies button color -navy blue
{
description: 'Validate social studies button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.list-group-item:nth-child(4) > .badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: Social Studies button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Social Studies button color matched as expected');
}
},
//Social Studies arrow icon
{
description: 'Verify social studies arrow icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(4) > .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Social Studies arrow icon not found');
}
console.log('Passed: Social Studies arrow icon present');
}
},
//World Languages label
{
description: 'Validate world languages label text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(5) > div:nth-child(3)')).getText();
if (elementText !== 'World Languages') {
throw new Error(`Expected: "World Languages" label text did not match; Actual: "${elementText}"`);
}
console.log('Passed: World Languages label text matched as expected');
}
},
//World Languages label button text
{
description: 'Validate world languages button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(5) > .badge')).getText();
if (elementText !== '375') {
throw new Error(`Expected: "World Languages" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: World Languages button text matched as expected');
}
},
//World Languages button color -navy blue
{
description: 'Validate world languages button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.list-group-item:nth-child(5) > .badge')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: World Languages button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: World Languages button color matched as expected');
}
},
//World Languages arrow icon
{
description: 'Verify world languages arrow icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(5) > .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('World Languages arrow icon not found');
}
console.log('Passed: World Languages arrow icon present');
}
},
//NEXT ACTION - AutoAlign link
{ description: 'Click AutoAlign tab link', action: async () => await driver.findElement(By.linkText('AutoAlign')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//Browse tab title (dimmed)
{
description: 'Validate browse tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Browse')).getText();
if (elementText !== 'Browse') {
throw new Error(`Expected: "Browse" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Browse tab title text matched as expected');
}
},
//Browse tab text title -gray (dimmed)
{
description: 'Validate browse tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Browse')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: "Browse" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse tab text title color matched as expected');
}
},
//Browse tab title -white (dimmed)
{
description: 'Validate browse tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Browse')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Expected: "Browse" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Browse tab title color matched as expected');
}
},
//By Standard tab title (dimmed)
{
description: 'Validate by standard tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('By Standard')).getText();
if (elementText !== 'By Standard') {
throw new Error(`Expected: "By Standard" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: By Standard tab title text matched as expected');
}
},
//By Standard tab text title -gray (dimmed)
{
description: 'Validate by standard tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('By Standard')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Expected: "By Standard" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: By Standard tab text title color matched as expected');
}
},
//By Standard tab title -white (dimmed)
{
description: 'Validate by standard tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('By Standard')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Expected: "By Standard" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: By Standard tab title color matched as expected');
}
},
//AutoAlign tab title (active)
{
description: 'Validate AutoAlign tab title',
action: async () => {
const elementText = await driver.findElement(By.linkText('AutoAlign')).getText();
if (elementText !== 'AutoAlign') {
throw new Error(`Expected: "AutoAlign" tab title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: AutoAlign tab title text matched as expected');
}
},
//AutoAlign tab text title -navy blue (active)
{
description: 'Validate AutoAlign tab text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AutoAlign')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Expected: "AutoAlign" tab text title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: AutoAlign tab text title color matched as expected');
}
},
//AutoAlign tab title -navy blue (active)
{
description: 'Validate AutoAlign tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AutoAlign')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "AutoAlign" tab title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: AutoAlign tab title color matched as expected');
}
},
//EdGates AutoAlign system...title
{
description: 'Validate EdGates AutoAlign title',
action: async () => {
const elementText = await driver.findElement(By.css('#suggest_form > b')).getText();
if (elementText !== `EdGate's AutoAlign system can suggest concepts that may be relevant`) {
throw new Error(`Expected: "EdGate's AutoAlign system can suggest concepts that may be relevant" tab title text did not match; Actual: "${elementText}"`);
}
console.log(`Passed: EdGate's AutoAlign system can suggest concepts that may be relevant title text matched as expected`);
}
},
//EdGates AutoAlign system...title font size -13px
{
description: `Validate EdGate's AutoAlign system can suggest concepts that may be relevant font size`,
action: async () => {
const elementStyle = await driver.findElement(By.css('#suggest_form > b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: EdGate's AutoAlign system can suggest concepts that may be relevant" title font size did not match; Actual: "${elementStyle}"`);
}
console.log(`Passed: EdGate's AutoAlign system can suggest concepts that may be relevant title font size matched as expected`);
}
},
/*Base Suggestion On sub-title
{
description: 'Validate Base Suggestion On sub-title',
action: async () => {
const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[1]')).getText();
if (elementText !== 'Base Suggestion On:') {
throw new Error(`Expected: "Base Suggestion On:" sub-title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Base Suggestion On: sub-title text matched as expected');
}
},*/
//Title checkbox
{
description: 'Verify Title checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox1')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Title checkbox not found');
}
console.log('Passed: Title checkbox present');
}
},
//Title checkbox label
{
description: 'Validate Title checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(1)')).getText();
if (elementText !== 'Title') {
throw new Error(`Expected: "Title" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Title checkbox label matched as expected');
}
},
//Description checkbox
{
description: 'Verify Description checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox2')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Description checkbox not found');
}
console.log('Passed: Description checkbox present');
}
},
//Description checkbox label
{
description: 'Validate Description checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(2)')).getText();
if (elementText !== 'Description') {
throw new Error(`Expected: "Description" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Description checkbox label matched as expected');
}
},
//Target Audience checkbox
{
description: 'Verify Target Audience checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox3')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Target Audience checkbox not found');
}
console.log('Passed: Target Audience checkbox present');
}
},
//Target Audience checkbox label
{
description: 'Validate Target Audience checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(3)')).getText();
if (elementText !== 'Target Audience') {
throw new Error(`Expected: ECS-2889 "Target Audience" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: ECS-2889 Target Audience checkbox label matched as expected');
}
},
//Ads checkbox
{
description: 'Verify Ads checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox4')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Ads checkbox not found');
}
console.log('Passed: Ads checkbox present');
}
},
//Ads checkbox label
{
description: 'Validate Ads checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(4)')).getText();
if (elementText !== 'Ads') {
throw new Error(`Expected: "Ads" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Ads checkbox label matched as expected');
}
},
//Content Type checkbox
{
description: 'Verify Content Type checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox5')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Content Type checkbox not found');
}
console.log('Passed: Content Type checkbox present');
}
},
//Content Type checkbox label
{
description: 'Validate Content Type checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(5)')).getText();
if (elementText !== 'Content Type') {
throw new Error(`Expected: "Content Type" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content Type checkbox label matched as expected');
}
},
//Format checkbox
{
description: 'Verify Format checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox6')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Format checkbox not found');
}
console.log('Passed: Format checkbox present');
}
},
//Format checkbox label
{
description: 'Validate Format checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(6)')).getText();
if (elementText !== 'Format') {
throw new Error(`Expected: "Format" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Format checkbox label matched as expected');
}
},
//Free or Fee checkbox
{
description: 'Verify Free or Fee checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox7')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Free or Fee checkbox not found');
}
console.log('Passed: Free or Fee checkbox present');
}
},
//Free or Fee checkbox label
{
description: 'Validate Free or Fee checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(7)')).getText();
if (elementText !== 'Free or Fee') {
throw new Error(`Expected: "Free or Fee" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Free or Fee checkbox label matched as expected');
}
},
//Grade Range checkbox
{
description: 'Verify Grade Range checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox8')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade Range checkbox not found');
}
console.log('Passed: Grade Range checkbox present');
}
},
//Grade Range checkbox label
{
description: 'Validate Grade Range checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(8)')).getText();
if (elementText !== 'Grade Range') {
throw new Error(`Expected: "Grade Rangee" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Grade Range checkbox label matched as expected');
}
},
//Language checkbox
{
description: 'Verify Language checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox9')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Languageg checkbox not found');
}
console.log('Passed: Language checkbox present');
}
},
//Language checkbox label
{
description: 'Validate Language checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(9)')).getText();
if (elementText !== 'Language') {
throw new Error(`Expected: "Language" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Language checkbox label matched as expected');
}
},
//Level-Challenging checkbox
{
description: 'Verify Level-Challenging checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox10')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Level-Challenging checkbox not found');
}
console.log('Passed: Level-Challenging checkbox present');
}
},
//Level-Challenging checkbox label
{
description: 'Validate Level-Challenging checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(10)')).getText();
if (elementText !== 'Level-Challenging') {
throw new Error(`Expected: "Level-Challenging" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Level-Challenging checkbox label matched as expected');
}
},
//Level-On Target checkbox
{
description: 'Verify Level-On Target checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox11')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Level-On Target checkbox not found');
}
console.log('Passed: Level-On Target checkbox present');
}
},
//Level-On Target checkbox label
{
description: 'Validate Level-On Target checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(11)')).getText();
if (elementText !== 'Level-On Target') {
throw new Error(`Expected: "Level-On Target" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Level-On Target checkbox label matched as expected');
}
},
//Level_Challenging checkbox
{
description: 'Verify Level_Challenging checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox12')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Level_Challenging checkbox not found');
}
console.log('Passed: Level_Challenging checkbox present');
}
},
//Level_Challenging checkbox label
{
description: 'Validate Level_Challenging checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(12)')).getText();
if (elementText !== 'Level_Challenging') {
throw new Error(`Expected: "Level_Challenging" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Level_Challenging checkbox label matched as expected');
}
},
//Level_On Target checkbox
{
description: 'Verify Level_On Target checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox13')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Level_On Target checkbox not found');
}
console.log('Passed: Level_On Target checkbox present');
}
},
//Level_On Target checkbox label
{
description: 'Validate Level_On Target checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(13)')).getText();
if (elementText !== 'Level_On Target') {
throw new Error(`Expected: "Level_On Target" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Level_On Target checkbox label matched as expected');
}
},
//Login Required checkbox
{
description: 'Verify Login Required checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox14')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Login Required checkbox not found');
}
console.log('Passed: Login Required checkbox present');
}
},
//Login Required checkbox label
{
description: 'Validate Login Required checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(14)')).getText();
if (elementText !== 'Login Required') {
throw new Error(`Expected: "Login Required" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Login Required checkbox label matched as expected');
}
},
//Printable checkbox
{
description: 'Verify Printable checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox15')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Printable checkbox not found');
}
console.log('Passed: Printable checkbox present');
}
},
//Printable checkbox label
{
description: 'Validate Printable checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(15)')).getText();
if (elementText !== 'Printable') {
throw new Error(`Expected: "Printable" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Printable checkbox label matched as expected');
}
},
//Source checkbox
{
description: 'Verify Source checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox16')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Source checkbox not found');
}
console.log('Passed: Source checkbox present');
}
},
//Source checkbox label
{
description: 'Validate Source checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(16)')).getText();
if (elementText !== 'Source') {
throw new Error(`Expected: "Source" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Source checkbox label matched as expected');
}
},
//Subject(s) checkbox
{
description: 'Verify Subject(s) checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox17')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject(s) checkbox not found');
}
console.log('Passed: Subject(s) checkbox present');
}
},
//Subject(s) checkbox label
{
description: 'Validate Subject(s)e checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(17)')).getText();
if (elementText !== 'Subject(s)') {
throw new Error(`Expected: "Subject(s)" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject(s) checkbox label matched as expected');
}
},
//Terms of Use checkbox
{
description: 'Verify Terms of Use checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox18')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Terms of Use checkbox not found');
}
console.log('Passed: Terms of Use checkbox present');
}
},
//Terms of Use checkbox label
{
description: 'Validate Terms of Use checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(18)')).getText();
if (elementText !== 'Terms of Use') {
throw new Error(`Expected: "Terms of Use" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Terms of Use checkbox label matched as expected');
}
},
//Alignment Status checkbox
{
description: 'Verify Alignment Status checkbox is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#inlineCheckbox19')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status checkbox not found');
}
console.log('Passed: Alignment Status checkbox present');
}
},
//Alignment Status checkbox label
{
description: 'Validate Alignment Status checkbox label',
action: async () => {
const elementText = await driver.findElement(By.css('.checkbox-inline:nth-child(19)')).getText();
if (elementText !== 'Alignment Status') {
throw new Error(`Expected: "Alignment Status" checkbox label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status checkbox label matched as expected');
}
},
/*# of Concepts label
{
description: 'Validate # of Concepts label',
action: async () => {
const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[2]')).getText();
if (elementText !== '# of Concepts') {
throw new Error(`Expected: "# of Concepts" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: # of Concepts label matched as expected');
}
},*/
//Subject Areas label
{
description: 'Validate Subject Areas label',
action: async () => {
const elementText = await driver.findElement(By.css('#conceptnum > option:nth-child(1)')).getText();
if (elementText !== '5') {
throw new Error(`Expected: # of Concepts dropdown value "5"; Actual: "${elementText}"`);
}
console.log('Passed: # of Concepts dropdown value "5" matched as expected');
}
},
/*Subject Areas label
{
description: 'Validate Subject Areas label',
action: async () => {
const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[3]')).getText();
if (elementText !== 'Subject Areas') {
throw new Error(`Expected: 33"Subject Areas" label did not match; Actual: "${elementText}"`);
}
console.log('Passed:44 Subject Areas label matched as expected');
}
},*/
//Subject Area value -Language Arts
{
description: 'Validate Subject Area value Language Arts text',
action: async () => {
const elementText = await driver.findElement(By.css('#concept_subjects > option:nth-child(1)')).getText();
if (elementText !== 'Language Arts') {
throw new Error(`Expected: Subject Areas: "Language Arts" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject Areas: Language Arts label matched as expected');
}
},
//Subject Area value -Mathematics
{
description: 'Validate Subject Area value Mathematics text',
action: async () => {
const elementText = await driver.findElement(By.css('#concept_subjects > option:nth-child(2)')).getText();
if (elementText !== 'Mathematics') {
throw new Error(`Expected: Subject Areas: "Mathematics" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject Areas: Mathematics label matched as expected');
}
},
//Subject Area value -Science
{
description: 'Validate Subject Area value Science text',
action: async () => {
const elementText = await driver.findElement(By.css('#concept_subjects > option:nth-child(3)')).getText();
if (elementText !== 'Science') {
throw new Error(`Expected: Subject Areas: "Science" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject Areas: Science label matched as expected');
}
},
//Subject Area value -Social Studies
{
description: 'Validate Subject Area value Social Studies text',
action: async () => {
const elementText = await driver.findElement(By.css('#concept_subjects > option:nth-child(4)')).getText();
if (elementText !== 'Social Studies') {
throw new Error(`Expected: Subject Areas: "Social Studies" label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject Areas: Social Studies label matched as expected');
}
},
//Suggest Concepts button text
{
description: 'Validate Suggest Concepts button text',
action: async () => {
const elementText = await driver.findElement(By.css('.btn:nth-child(9)')).getText();
if (elementText !== 'Suggest Concepts') {
throw new Error(`Expected: "Suggest Concepts" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggest Concepts button text matched as expected');
}
},
//Suggest Concepts button icon
{
description: 'Verify Suggest Concepts button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.glyphicon-tags')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggest Concepts button icon not found');
}
console.log('Passed: Suggest Concepts button icon present');
}
},
//Suggest Concepts button color -green
{
description: 'Validate Suggest Concepts button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.btn:nth-child(9)')).getCssValue('background-color');
if (elementValue !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: "Suggest Concepts" button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggest Concepts button color matched as expected');
}
},
//NEXT ACTION
{ description: 'Select Description checkbox', action: async () => await driver.findElement(By.css('#inlineCheckbox2')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//NEXT ACTION
{ description: 'Select Subject Area - Science', action: async () => await driver.findElement(By.css('#concept_subjects > option:nth-child(3)')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//NEXT ACTION
{ description: 'Click Suggest Concepts button', action: async () => await driver.findElement(By.css('.btn:nth-child(9)')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//Scroll to Find Concepts widget title
{
description: 'Scroll to Find Concepts widget title',
action: async () => {
const location = await driver.findElement(By.css('p'));
await driver.actions()
.scroll(0, 0, 0, 0, location)
.perform()
}
},
//Suggested Concept 1 Add button
{
description: 'Validate Suggested Concept 1 Add button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(1) > .btn')).getText();
if (elementText !== 'Add') {
throw new Error(`Expected: Suggested Concept 1 Add button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 1 Add button text matched as expected');
}
},
//Suggested Concept 1 Add button icon
{
description: 'Verify Suggested Concept 1 Add button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 1 Add button icon not found');
}
console.log('Passed: Suggested Concept 1 Add button icon present');
}
},
//Suggested Concept 1 Add button color -green
{
description: 'Validate Suggested Concept 1 Add button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(1) > .btn')).getCssValue('background-color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Suggested Concept 1 Add button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggested Concept 1 Add button color matched as expected');
}
},
//Suggested Concept 1 label
{
description: 'Validate Suggested Concept 1 label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(1)')).getText();
if (elementText !== 'History / Technology / Social Perspectives | Advancement of Science') {
throw new Error(`Expected: Suggested Concept 1 label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 1 label matched as expected');
}
},
//Suggested Concept 1 primary toggle button
{
description: 'Verify Suggested Concept 1 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 1 "Primary" toggle button icon not found');
}
console.log('Passed: Suggested Concept 1 Primary toggle button icon present');
}
},
//Suggested Concept 2 Add button
{
description: 'Validate Suggested Concept 2 Add button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) > .btn-success')).getText();
if (elementText !== 'Add') {
throw new Error(`Expected: Suggested Concept 2 Add button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 2 Add button text matched as expected');
}
},
//Suggested Concept 2 Add button icon
{
description: 'Verify Suggested Concept 2 Add button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) .btn-success > .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 2 Add button icon not found');
}
console.log('Passed: Suggested Concept 2 Add button icon present');
}
},
//Suggested Concept 2 Add button color -green
{
description: 'Validate Suggested Concept 2 Add button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(2) > .btn-success')).getCssValue('background-color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Suggested Concept 2 Add button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggested Concept 2 Add button color matched as expected');
}
},
//Suggested Concept 2 label
{
description: 'Validate Suggested Concept 2 label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(2)')).getText();
if (elementText !== 'History / Technology / Social Perspectives | Advancement of Science') {
throw new Error(`Expected: Suggested Concept 2 label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 2 label matched as expected');
}
},
//Suggested Concept 2 primary toggle button
{
description: 'Verify Suggested Concept 2 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 2 "Primary" toggle button icon not found');
}
console.log('Passed: Suggested Concept 2 Primary toggle button icon present');
}
},
//Suggested Concept 3 Add button
{
description: 'Validate Suggested Concept 3 Add button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn')).getText();
if (elementText !== 'Add') {
throw new Error(`Expected: Suggested Concept 3 Add button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 3 Add button text matched as expected');
}
},
//Suggested Concept 3 Add button icon
{
description: 'Verify Suggested Concept 3 Add button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(3) .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 3 Add button icon not found');
}
console.log('Passed: Suggested Concept 3 Add button icon present');
}
},
//Suggested Concept 3 Add button color -green
{
description: 'Validate Suggested Concept 3 Add button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn')).getCssValue('background-color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Suggested Concept 3 Add button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggested Concept 3 Add button color matched as expected');
}
},
//Suggested Concept 3 label
{
description: 'Validate Suggested Concept 3 label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(3)')).getText();
if (elementText !== 'Science | History / Technology / Social Perspectives | Nature of Science') {
throw new Error(`Expected: Suggested Concept 3 label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 3 label matched as expected');
}
},
//Suggested Concept 3 primary toggle button
{
description: 'Verify Suggested Concept 3 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(3) .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 3 "Primary" toggle button icon not found');
}
console.log('Passed: Suggested Concept 3 Primary toggle button icon present');
}
},
//Suggested Concept 4 Add button
{
description: 'Validate Suggested Concept 4 button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(4) > .btn-success')).getText();
if (elementText !== 'Add') {
throw new Error(`Expected: Suggested Concept 4 Add button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 4 Add button text matched as expected');
}
},
//Suggested Concept 4 Add button icon
{
description: 'Verify Suggested Concept 4 Add button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(4) .btn-success > .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 4 Add button icon not found');
}
console.log('Passed: Suggested Concept 4 Add button icon present');
}
},
//Suggested Concept 4 Add button color -green
{
description: 'Validate Suggested Concept 4 Add button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(4) > .btn-success')).getCssValue('background-color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Suggested Concept 4 Add button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggested Concept 4 Add button color matched as expected');
}
},
//Suggested Concept 4 label
{
description: 'Validate Suggested Concept 4 label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(4)')).getText();
if (elementText !== `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`) {
throw new Error(`Expected: Suggested Concept 4 label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 4 label matched as expected');
}
},
//Suggested Concept 4 primary toggle button
{
description: 'Verify Suggested Concept 4 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(4) .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 4 "Primary" toggle button icon not found');
}
console.log('Passed: Suggested Concept 4 Primary toggle button icon present');
}
},
//Suggested Concept 5 Add button
{
description: 'Validate Suggested Concept 5 Add button text',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).getText();
if (elementText !== 'Add') {
throw new Error(`Expected: Suggested Concept 5 Add button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 5 Add button text matched as expected');
}
},
//Suggested Concept 5 Add button icon
{
description: 'Verify Suggested Concept 5 Add button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(5) .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 5 Add button icon not found');
}
console.log('Passed: Suggested Concept 5 Add button icon present');
}
},
//Suggested Concept 5 Add button color -green
{
description: 'Validate Suggested Concept 5 Add button color',
action: async () => {
const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).getCssValue('background-color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Suggested Concept 5 Add button color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Suggested Concept 5 Add button color matched as expected');
}
},
//Suggested Concept 5 label
{
description: 'Validate Suggested Concept 5 label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(5)')).getText();
if (elementText !== 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming') {
throw new Error(`Expected: Suggested Concept 5 label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Suggested Concept 5 label matched as expected');
}
},
//Suggested Concept 5 primary toggle button
{
description: 'Verify Suggested Concept 5 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(5) .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Suggested Concept 5 "Primary" toggle button icon not found');
}
console.log('Passed: Suggested Concept 5 Primary toggle button icon present');
}
},
//NEXT ACTION - Click concept 5 Primary toggle
{ description: 'Click Concept 5 Primary toggle icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(5) label')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//Suggested Concept 5 Primary label
{
description: 'Validate Suggested Concept 5 Primary label',
action: async () => {
const elementText = await driver.findElement(By.css('#suggested_concepts > ul > li:nth-child(5) > div > label > span')).getText();
if (elementText !== 'Primary') {
throw new Error(`Expected: "Primary" toggle indicator; Actual: "${elementText}"`);
}
console.log('Passed: Primary toggle indicator displayed as expected');
}
},
//NEXT ACTION - Click concept 5 Add button
{ description: 'Click Concept 5 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).click() },
//Added suggested concept confirmation alert title
{
description: 'Validate Added suggested concept confirmation alert DIV title',
action: async () => {
const elementText = await driver.findElement(By.css('.mr-auto')).getText();
if (elementText !== 'Add Concept') {
throw new Error(`Expected: "Add Concept" DIV title; Actual: "${elementText}"`);
}
console.log('Passed: Add Concept DIV title displayed as expected');
}
},
//Added suggested concept confirmation alert title color -green
{
description: 'Validate Added suggested concept confirmation alert title color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-header')).getCssValue('color');
if (elementValue !== 'rgba(108, 117, 125, 1)') {
throw new Error(`Expected: Added suggested concept confirmation alert title color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Added suggested concept confirmation alert title color matched as expected');
}
},
//Added suggested concept confirmation X icon
{
description: 'Verify Added suggested concept confirmation Xicon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.ml-2 > span')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Added suggested concept confirmation X icon not found');
}
console.log('Passed: Added suggested concept confirmation X icon present');
}
},
//Added suggested concept confirmation alert description
{
description: 'Validate Added suggested concept confirmation alert DIV description',
action: async () => {
const elementText = await driver.findElement(By.css('.toast-body')).getText();
if (elementText !== 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming') {
throw new Error(`Expected: "Science | Life Science (Biology) | Environment | Human Factors | Global Warming" Confirmation DIV description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Confirmation DIV description text displayed as expected');
}
},
//Added suggested concept confirmation alert description text color -green
{
description: 'Validate Added suggested concept confirmation alert description text color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-body')).getCssValue('color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Added suggested concept confirmation alert description text color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Added suggested concept confirmation alert description text color matched as expected');
}
},
//Scroll to page title - Edit Item
{
description: 'Scrolled to page title',
action: async () => {
const location = await driver.findElement(By.css('#myModalLabel'));
await driver.actions()
.scroll(0, 0, 0, 0, location)
.perform()
}
},
//Tagged Concepts widget title
{
description: 'Validate Tagged Concepts widget title text',
action: async () => {
const elementText = await driver.findElement(By.css('.ui-widget-heading')).getText();
if (elementText !== 'Tagged Concepts:') {
throw new Error(`Expected: "Tagged Concepts:" widget title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concepts: widget title text matched as expected');
}
},
//Tagged Concepts widget title font size -16px
{
description: 'Validate Tagged Concepts widget title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('.ui-widget-heading')).getCssValue('font-size');
if (elementStyle !== '16px') {
throw new Error(`Expected: "Tagged Concepts:" widget title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concepts: widget title font size matched as expected');
}
},
//Tagged Concept 1 header text
{
description: 'Validate Tagged Concept 1 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')).getText();
if (elementText !== 'Science | Earth Science | Climate') {
throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 header text matched as expected');
}
},
//Tagged concept 1 header text color -gray
{
description: 'Validate Tagged concept 1 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 header text color matched as expected');
}
},
//Tagged Concept 1 remove button icon
{
description: 'Verify Tagged Concept remove button 1 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 1 Remove button icon present');
}
},
//Tagged Concept 1 remove button text
{
description: 'Validate Tagged Concept 1 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k749 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 Remove button text matched as expected');
}
},
//Tagged Concept 1 remove button color -red
{
description: 'Validate Tagged Concept 1 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove button color matched as expected');
}
},
//Tagged Concept 1 remove button -tooltip
{
description: 'Validate Tagged Concept 1 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 1 primary toggle button
{
description: 'Verify Tagged Concept 1 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 1 Primary toggle button icon present');
}
},
//Tagged Concept 2 header text
{
description: 'Validate Tagged Concept 2 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')).getText();
if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) {
throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 header text matched as expected');
}
},
//Tagged Concept 2 header text color -gray
{
description: 'Validate Tagged Concept 2 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 header text color matched as expected');
}
},
//Tagged Concept 2 remove button icon
{
description: 'Verify Tagged Concept remove button 2 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 2 Remove button icon present');
}
},
//Tagged Concept 2 remove button text
{
description: 'Validate Tagged Concept 2 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k937 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 Remove button text matched as expected');
}
},
//Tagged Concept 2 remove button color -red
{
description: 'Validate Tagged Concept 2 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove button color matched as expected');
}
},
//Tagged Concept 2 remove button -tooltip
{
description: 'Validate Tagged Concept 2 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 2 primary toggle button
{
description: 'Verify Tagged Concept 2 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 2 Primary toggle button icon present');
}
},
//Tagged Concept 3 header text
{
description: 'Validate Tagged Concept 3 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')).getText();
if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') {
throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 header text matched as expected');
}
},
//Tagged Concept 3 header text color -gray
{
description: 'Validate Tagged Concept 3 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 header text color matched as expected');
}
},
//Tagged Concept 3 remove button icon
{
description: 'Verify Tagged Concept remove button 3 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 3 Remove button icon present');
}
},
//Tagged Concept 3 remove button text
{
description: 'Validate Tagged Concept 3 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 Remove button text matched as expected');
}
},
//Tagged Concept 3 remove button color -red
{
description: 'Validate Tagged Concept 3 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove button color matched as expected');
}
},
//Tagged Concept 3 remove button -tooltip
{
description: 'Validate Tagged Concept 3 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 3 primary toggle button
{
description: 'Verify Tagged Concept 3 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 3 Primary toggle button icon present');
}
},
//Tagged Concept 4 header text
{
description: 'Validate Tagged Concept 4 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')).getText();
if (elementText !== 'Science | General') {
throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 header text matched as expected');
}
},
//Tagged Concept 4 header text color -gray
{
description: 'Validate Tagged Concept 4 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 header text color matched as expected');
}
},
//Tagged Concept 4 remove button icon
{
description: 'Verify Tagged Concept remove button 4 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 4 Remove button icon present');
}
},
//Tagged Concept 4 remove button text
{
description: 'Validate Tagged Concept 4 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 Remove button text matched as expected');
}
},
//Tagged Concept 4 remove button color -red
{
description: 'Validate Tagged Concept 4 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove button color matched as expected');
}
},
//Tagged Concept 4 remove button -tooltip
{
description: 'Validate Tagged Concept 4 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 4 primary toggle button
{
description: 'Verify Tagged Concept 4 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 4 Primary toggle button icon present');
}
},
//Tagged Concept 5 header text
{
description: 'Validate Tagged Concept 5 header text',
action: async () => {
const elementText = await driver.findElement(By.css('#k11532278')).getText();
if (elementText !== 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming') {
throw new Error(`Expected: Tagged Concept 5 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 5 header text matched as expected');
}
},
//Tagged concept 5 header text color -gray
{
description: 'Validate Tagged concept 5 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k11532278')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 51 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 header text color matched as expected');
}
},
//Tagged Concept 5 remove button icon
{
description: 'Verify Tagged Concept remove button 5 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.btn:nth-child(2) > .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 5 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 5 Remove button icon present');
}
},
//Tagged Concept 5 remove button text
{
description: 'Validate Tagged Concept 5 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('.btn-danger:nth-child(2)')).getText();
if (elementText !== ' Remove') {
throw new Error(`Expected: Tagged Concept 5 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 5 Remove button text matched as expected');
}
},
//Tagged Concept 5 remove button color -red
{
description: 'Validate Tagged Concept 5 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.btn-danger:nth-child(2)')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 5 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 Remove button color matched as expected');
}
},
//Tagged Concept 5 remove button -tooltip
{
description: 'Validate Tagged Concept 5 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('.btn-danger:nth-child(2)')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 5 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 5 primary toggle button text
{
description: 'Validate Tagged Concept 5 primary toggle button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k11532278 > div > label > span')).getText();
if (elementText !== 'Primary') {
throw new Error(`Expected: Tagged Concept 5 "Primary" toggle button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 5 Primary toggle button text matched as expected');
}
},
//Tagged Concept 5 active primary toggle button color -green
{
description: 'Validate Tagged Concept 5 active primary toggle button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k11532278 > div > label > span')).getCssValue('color');
if (elementStyle !== 'rgba(255, 255, 255, 1)') {
throw new Error(`Expected: Tagged Concept 5 active "Primary" toggle button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 active Primary toggle button color matched as expected');
}
},
//NEXT ACTION - Click concept 2 Add button {ECS-2852 Update the "Add" icon after selecting item}
{ description: 'Click Concept 2 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .btn-success')).click() },
//Added suggested concept confirmation alert title
{
description: 'Validate Added suggested concept confirmation alert DIV title',
action: async () => {
const elementText = await driver.findElement(By.css('.mr-auto')).getText();
if (elementText !== 'Add Concept') {
throw new Error(`Expected: "Add Concept" DIV title; Actual: "${elementText}"`);
}
console.log('Passed: Add Concept DIV title displayed as expected');
}
},
//Added suggested concept confirmation alert title color -green
{
description: 'Validate Added suggested concept confirmation alert title color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-header')).getCssValue('color');
if (elementValue !== 'rgba(108, 117, 125, 1)') {
throw new Error(`Expected: Added suggested concept confirmation alert title color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Added suggested concept confirmation alert title color matched as expected');
}
},
//Added suggested concept confirmation X icon
{
description: 'Verify Added suggested concept confirmation Xicon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.ml-2 > span')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Added suggested concept confirmation X icon not found');
}
console.log('Passed: Added suggested concept confirmation X icon present');
}
},
//Added suggested concept confirmation alert description
{
description: 'Validate Added suggested concept confirmation alert DIV description',
action: async () => {
const elementText = await driver.findElement(By.css('.toast-body')).getText();
if (elementText !== 'Concept added already') {
throw new Error(`Expected: "Concept added already" Confirmation DIV description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Confirmation DIV description text displayed as expected');
}
},
//Added suggested concept confirmation alert description text color -green
{
description: 'Validate Added suggested concept confirmation alert description text color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-body')).getCssValue('color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Added suggested concept confirmation alert description text color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Added suggested concept confirmation alert description text color matched as expected');
}
},
//NEXT ACTION - Click Save Changes button
{ description: 'Wait for page to redirect back', action: async () => await driver.sleep(5000) },
{ description: 'Click Save Changes button', action: async () => await driver.findElement(By.css('.submit-content-button')).click() },
//Wait for confirmation bannter to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.msg_success')), 10000).catch(() => false);
}
},
//Page title
{
description: 'Validate Page title',
action: async () => {
const elementText = await driver.findElement(By.css('#myModalLabel')).getText();
if (elementText !== 'Edit Item') {
throw new Error(`Expected: "Edit Item" page title did not match; Actual: "${elementText}"`);
}
console.log('Passed: Edit Item page title matched as expected');
}
},
//Page title color -navy blue
{
description: 'Validate Page title color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Edit Item" page title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title color matched as expected');
}
},
//Page title font size -32px
{
description: 'Validate Page title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Expected: "Edit Item" page title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title font size matched as expected');
}
},
//Submission confirmation banner text
{
description: 'Validate Submission confirmation banner text',
action: async () => {
const elementText = await driver.findElement(By.css('.msg_success')).getText();
if (elementText !== 'Thank you for your submission! A moderator will review your submission before it is posted.') {
throw new Error(`Expected: Submission confirmation banner text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Submission confirmation banner text displayed as expected');
}
},
//Submission confirmation banner text color -blue
{
description: 'Validate Submission confirmation banner text color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-body')).getCssValue('color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Submission confirmation banner text color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Submission confirmation banner text color matched as expected');
}
},
//Driver sleep
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//Wait for confirmation bannter to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.linkText('Home')), 10000).catch(() => false);
}
},
//Home breadcrumb link
{
description: 'Validate Home link',
action: async () => {
const elementText = await driver.findElement(By.linkText('Home')).getText();
if (elementText !== 'Home') {
throw new Error(`Expected: "Home"; Actual: "${elementText}"`);
}
console.log('Passed: Home link matched as expected');
}
},
//Content breadcrumb
{
description: 'Validate Content breadcrumb',
action: async () => {
const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content link matched as expected');
}
},
//Content breadcrumb text color -green
{
description: 'Validate Content breadcrumb text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content breadcrumb text color matched as expected');
}
},
//NEXT ACTION - Navigate to Approve page
{ description: 'Click Approve navigation link', action: async () => await driver.findElement(By.linkText('Approve')).click() },
//Wait for page to load - Correlation Coverages View Details button
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('h2')), 10000).catch(() => false);
}
},
//Content Approval page title
{
description: 'Validate Content Approval page title',
action: async () => {
const elementText = await driver.findElement(By.css('h2')).getText();
if (elementText !== 'Content Approval') {
throw new Error(`Expected: "Content Approval"; Actual: "${elementText}"`);
}
console.log('Passed: Content Approval page title matched as expected');
}
},
//Content Approval page title text color -dark blue
{
description: 'Validate Content Approval page title text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Content Approval page title text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content Approval page title text color matched as expected');
}
},
//Content Approval page title text font
{
description: 'Validate Content Approval page title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Content Approval page title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content Approval page title text font-size matched as expected');
}
},
//Data Range text handle
{
description: 'Validate Data range text handle',
action: async () => {
const elementText = await driver.findElement(By.css('#get_report')).getText(); //.form-group:nth-child(1) > .form-label
if (elementText !== 'Data range:') {
throw new Error(`Expected: "Data range: Start"; Actual: "${elementText}"`);
}
console.log('Passed: Data range: Start text handle matched as expected');
}
},
//End text handle
{
description: 'Validate End text handle',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(2) > .form-label')).getText();
if (elementText !== 'End') {
throw new Error(`Expected: "End"; Actual: "${elementText}"`);
}
console.log('Passed: End text handle matched as expected');
}
},
//Submit button text
{
description: 'Validate Submit button text',
action: async () => {
const elementValue = await driver.findElement(By.css('#submit')).getAttribute('value');
if (elementValue !== 'Submit') {
throw new Error(`Expected: "Submit" button text; Actual: "${elementValue}"`);
}
console.log('Passed: Submit button text matched as expected');
}
},
//Submit button text color -green
{
description: 'Validate Submit button text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#submit')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Submit button text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Submit button text color matched as expected');
}
},
//Pending Alignments tab label (active)
{
description: 'Validate Pending Alignmentstab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Pending Alignments')).getText();
if (elementText !== 'Pending Alignments') {
throw new Error(`Expected: "Pending Alignments"; Actual: "${elementText}"`);
}
console.log('Passed: Pending Alignments tab label matched as expected');
}
},
//Pending Alignments tab text color -blue (active)
{
description: 'Validate Pending Alignments tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Pending Alignments')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Pending Alignments tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pending Alignments tab text color matched as expected');
}
},
//Content Submissions tab label (dimmed)
{
description: 'Validate Content Submissions tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Content Submissions')).getText();
if (elementText !== 'Content Submissions') {
throw new Error(`Expected: "Content Submissions"; Actual: "${elementText}"`);
}
console.log('Passed: Content Submissions tab label matched as expected');
}
},
//Content Submissions tab text color -gray (dimmed)
{
description: 'Validate Content Submissions tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Content Submissions')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Content Submissions tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content Submissions tab text color matched as expected');
}
},
//Approval History tab label (dimmed)
{
description: 'Validate Approval History tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Approval History')).getText();
if (elementText !== 'Approval History') {
throw new Error(`Expected: "Approval History"; Actual: "${elementText}"`);
}
console.log('Passed: Approval History tab label matched as expected');
}
},
//Approval History tab text color -white (dimmed)
{
description: 'Validate Approval History tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Approval History')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Approval History tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Approval History tab text color matched as expected');
}
},
//Rejection History tab label (dimmed)
{
description: 'Validate Rejection History tab label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Rejection History')).getText();
if (elementText !== 'Rejection History') {
throw new Error(`Expected: "Rejection History"; Actual: "${elementText}"`);
}
console.log('Passed: Rejection History tab label matched as expected');
}
},
//Rejection History tab text color -white (dimmed)
{
description: 'Validate Rejection History tab color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Rejection History')).getCssValue('color');
if (elementStyle !== 'rgba(182, 186, 181, 1)') {
throw new Error(`Rejection History tab text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Rejection History tab text color matched as expected');
}
},
//Results header text
{
description: 'Validate Results header text',
action: async () => {
const elementText = await driver.findElement(By.css('#pagepending td:nth-child(1)')).getText();
if (elementText !== 'Results 1 - 1 of 1') {
throw new Error(`Expected: "Results 1 - 1 of 1" text label; Actual: "${elementText}"`);
}
console.log('Passed: Results 1 - 1 of 1 text label matched as expected');
}
},
//Filter textbox value
{
description: 'Validate Filter value text',
action: async () => {
const elementValue = await driver.findElement(By.css('.pending_search')).getAttribute('placeholder');
if (elementValue !== 'filter.....') {
throw new Error(`Expected: "filter....." text value; Actual: "${elementValue}"`);
}
console.log('Passed: filter..... text value matched as expected');
}
},
//Title column text
{
description: 'Validate Title column text',
action: async () => {
const elementText = await driver.findElement(By.css('#myTablePendings th:nth-child(1)')).getText();
if (elementText !== 'Title') {
throw new Error(`Expected: "Title" column text; Actual: "${elementText}"`);
}
console.log('Passed: Title column text matched as expected');
}
},
//Title column text color -gray
{
description: 'Validate Title column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myTablePendings th:nth-child(1)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Title column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Title column text color matched as expected');
}
},
//Edit column text
{
description: 'Validate Edit column text',
action: async () => {
const elementText = await driver.findElement(By.css('.cen:nth-child(2)')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: "Edit" column text; Actual: "${elementText}"`);
}
console.log('Passed: Edit column text matched as expected');
}
},
//Edit column text color -gray
{
description: 'Validate Edit column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.cen:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Edit column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit column text color matched as expected');
}
},
//Aligned By column text
{
description: 'Validate Aligned By column text',
action: async () => {
const elementText = await driver.findElement(By.css('#myTablePendings th:nth-child(3)')).getText();
if (elementText !== 'Aligned By') {
throw new Error(`Expected: "Aligned By" column text; Actual: "${elementText}"`);
}
console.log('Passed: Aligned By column text matched as expected');
}
},
//Aligned By column text color -gray
{
description: 'Validate Aligned By column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myTablePendings th:nth-child(3)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Aligned By column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Aligned By column text color matched as expected');
}
},
//Alignment column text
{
description: 'Validate Alignment column text',
action: async () => {
const elementText = await driver.findElement(By.css('#myTablePendings .cen:nth-child(4)')).getText();
if (elementText !== 'Alignment') {
throw new Error(`Expected: "Alignment" column text; Actual: "${elementText}"`);
}
console.log('Passed: Alignment column text matched as expected');
}
},
//Alignment column text color -gray
{
description: 'Validate Alignment column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myTablePendings .cen:nth-child(4)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Alignment column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Alignment column text color matched as expected');
}
},
//Approve column text
{
description: 'Validate Approve column text',
action: async () => {
const elementText = await driver.findElement(By.css('.cen:nth-child(5)')).getText();
if (elementText !== 'Approve') {
throw new Error(`Expected: "Approve" column text; Actual: "${elementText}"`);
}
console.log('Passed: Approve column text matched as expected');
}
},
//Approve column text color -gray
{
description: 'Validate Approve column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.cen:nth-child(5)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Approve column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Approve column text color matched as expected');
}
},
//Reject column text
{
description: 'Validate Reject column text',
action: async () => {
const elementText = await driver.findElement(By.css('#myTablePendings .cen:nth-child(6)')).getText();
if (elementText !== 'Reject') {
throw new Error(`Expected: "Reject" column text; Actual: "${elementText}"`);
}
console.log('Passed: Reject column text matched as expected');
}
},
//Reject column text color -gray
{
description: 'Validate Reject column text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myTablePendings .cen:nth-child(6)')).getCssValue('color');
if (elementStyle !== 'rgba(94, 105, 116, 1)') {
throw new Error(`Reject column text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Reject column text color matched as expected');
}
},
//Abrupt Climate Change text title
{
description: 'Validate Abrupt Climate Change text title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText();
if (elementText !== 'Abrupt Climate Change') {
throw new Error(`Expected: "Abrupt Climate Change" text title; Actual: "${elementText}"`);
}
console.log('Passed: Abrupt Climate Change text title matched as expected');
}
},
//Edit button icon
{
description: 'Verify Edit button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('td:nth-child(2) .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Edit" button icon not found');
}
console.log('Passed: Edit button icon present');
}
},
//exact_juan text link
{
description: 'Validate exact_juan text link',
action: async () => {
const elementText = await driver.findElement(By.linkText('exact_juan')).getText();
if (elementText !== 'exact_juan') {
throw new Error(`Expected: "exact_juan" text link; Actual: "${elementText}"`);
}
console.log('Passed: exact_juan text link matched as expected');
}
},
//Alignment icon
{
description: 'Verify Alignment icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-sitemap')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Alignment" icon not found');
}
console.log('Passed: Alignment icon present');
}
},
//Approve icon
{
description: 'Verify Approve icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('a > .fa-check-circle')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Approve" icon not found');
}
console.log('Passed: Approve icon present');
}
},
//Reject icon
{
description: 'Verify Reject icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('a > .fa-times-circle')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('"Reject" icon not found');
}
console.log('Passed: Reject icon present');
}
},
//NEXT ACTION - Approve content change
{ description: 'Click Approve icon', action: async () => await driver.findElement(By.css('a > .fa-check-circle')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
//No Pending text
{
description: 'Validate No Pending text',
action: async () => {
const elementText = await driver.findElement(By.css('#tabs-2 b')).getText();
if (elementText !== `No aligned content pending approval at this time for this user's group for the date(s) chosen.`) {
throw new Error(`Expected: "No aligned content pending approval at this time for this user's group for the date(s) chosen." text; Actual: "${elementText}"`);
}
console.log('Passed: No aligned content pending... text matched as expected');
}
},
//NEXT ACTION - Navigate to Align page
{ description: 'Click Align navigation link', action: async () => await driver.findElement(By.linkText('Align')).click() },
//Wait for page to load - Correlation Coverages View Details button
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('h2')), 10000).catch(() => false);
}
},
//NEXT ACTION - Navigate to Align page
{ description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() },
//Wait page to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.well > b')), 10000).catch(() => false);
}
},
//FILTERS
//Filter Results title
{
description: 'Validate Filter Results title',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getText();
if (elementText !== 'Filter Results') {
throw new Error(`Expected: "Filter Results"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title matched as expected');
}
},
//Filter Results title font size
{
description: 'Validate Filter Results title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.well > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Filter Results title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Filter Results title font size matched as expected');
}
},
//Content Set title
{
description: 'Validate Content Set title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getText();
if (elementText !== 'Content Set') {
throw new Error(`Expected: "Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title matched as expected');
}
},
//Content Set title font size
{
description: 'Validate Content Set title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Content Set title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Content Set title font size matched as expected');
}
},
//Biology - QA checkbox
{
description: 'Verify Biology - QA checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaorgobjectid873576067')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Biology - QA checkbox icon not found');
}
console.log('Passed: Biology - QA checkbox icon present');
}
},
//Biology - QA count
{
description: 'Validate Biology - QA count',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText();
if (elementText !== 'Biology - QA (1046)') {
throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`);
}
console.log('Passed: Biology - QA (1046) label matched as expected');
}
},
//Grade title
{
description: 'Validate Grade title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getText();
if (elementText !== 'Grade') {
throw new Error(`Expected: "Grade"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title matched as expected');
}
},
//Grade title font size
{
description: 'Validate Grade title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Grade title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Grade title font size matched as expected');
}
},
//Grade: 9 checkbox
{
description: 'Verify Grade: 9 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades49')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 9 checkbox icon not found');
}
console.log('Passed: Grade 9 checkbox icon present');
}
},
//Grade: 9 label
{
description: 'Validate Grade: 9 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(4)')).getText();
if (elementText !== '9') {
throw new Error(`Expected: Grade: "9" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 9 label matched as expected');
}
},
//Grade: 10 checkbox
{
description: 'Verify Grade: 10 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades51')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 10 checkbox icon not found');
}
console.log('Passed: Grade 10 checkbox icon present');
}
},
//Grade: 10 label
{
description: 'Validate Grade: 10 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(7)')).getText();
if (elementText !== '10') {
throw new Error(`Expected: Grade: "10" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 10 label matched as expected');
}
},
//Grade: 11 checkbox
{
description: 'Verify Grade: 11 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades52')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 11 checkbox icon not found');
}
console.log('Passed: Grade 11 checkbox icon present');
}
},
//Grade: 11 label
{
description: 'Validate Grade: 11 label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(10)')).getText();
if (elementText !== '11') {
throw new Error(`Expected: Grade: "11" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 11 label matched as expected');
}
},
//Grade: 12 checkbox
{
description: 'Verify Grade: 12 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades53')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 12 checkbox icon not found');
}
console.log('Passed: Grade 12 checkbox icon present');
}
},
//Grade: 12 label
{
description: 'Validate Grade: 12 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(13)')).getText();
if (elementText !== '12') {
throw new Error(`Expected: Grade: "12" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 12 label matched as expected');
}
},
//Grade: 8 checkbox
{
description: 'Verify Grade: 8 checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades48')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Grade: 8 checkbox icon not found');
}
console.log('Passed: Grade 8 checkbox icon present');
}
},
//Grade: 8 label
{
description: 'Validate Grade: 8 label',
action: async () => {
const elementText = await driver.findElement(By.css('label:nth-child(16)')).getText();
if (elementText !== '8') {
throw new Error(`Expected: Grade: "8" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade 8 label matched as expected');
}
},
//Grade: More>> label
{
description: 'Validate Grade: More label',
action: async () => {
const elementText = await driver.findElement(By.linkText('More>>')).getText();
if (elementText !== 'More>>') {
throw new Error(`Expected: Grade: "More>>" label; Actual: "${elementText}"`);
}
console.log('Passed: Grade More>> label matched as expected');
}
},
//Subject title
{
description: 'Validate Subject title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getText();
if (elementText !== 'Subject') {
throw new Error(`Expected: "Subject"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title matched as expected');
}
},
//Subject title font size
{
description: 'Validate Subject title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Subject title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Subject title font size matched as expected');
}
},
//Subject: Science checkbox
{
description: 'Verify Subject: Science checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsScience')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Science checkbox icon not found');
}
console.log('Passed: Subject Science checkbox icon present');
}
},
//Subject: Science label
{
description: 'Validate Subject: Science label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText();
if (elementText !== 'Science') {
throw new Error(`Expected: Subject: "Science" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Science label matched as expected');
}
},
//Subject: Mathematics checkbox
{
description: 'Verify Subject: Mathematics checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Mathematics checkbox icon not found');
}
console.log('Passed: Subject Mathematics checkbox icon present');
}
},
//Subject: Mathematics label
{
description: 'Validate Subject: Mathematics label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText();
if (elementText !== 'Mathematics') {
throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Mathematics label matched as expected');
}
},
//Subject: Language Arts checkbox
{
description: 'Verify Subject: Language Arts checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsLanguage\\ Arts')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Language Arts checkbox icon not found');
}
console.log('Passed: Subject Language Arts checkbox icon present');
}
},
//Subject: Language Arts label
{
description: 'Validate Subject: Language Arts label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText();
if (elementText !== 'Language Arts') {
throw new Error(`Expected: Subject: "Language Arts" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Language Arts label matched as expected');
}
},
//Subject: Social Studies checkbox
{
description: 'Verify Subject: Social Studies checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ Studies')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Social Studies checkbox icon not found');
}
console.log('Passed: Subject Social Studies checkbox icon present');
}
},
//Subject: Social Studies label
{
description: 'Validate Subject: Social Studies label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(13)')).getText();
if (elementText !== 'Social Studies') {
throw new Error(`Expected: Subject: "Social Studies" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Social Studies label matched as expected');
}
},
//Subject: Social and Emotional Learning checkbox
{
description: 'Verify Subject: Social and Emotional Learning checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ and\\ Emotional\\ Learning')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Subject: Social and Emotional Learning checkbox icon not found');
}
console.log('Passed: Subject Social and Emotional Learning checkbox icon present');
}
},
//Subject: Social and Emotional Learning label
{
description: 'Validate Subject: Social and Emotional Learning label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(16)')).getText();
if (elementText !== 'Social and Emotional Learning') {
throw new Error(`Expected: Subject: "Social and Emotional Learninge" label; Actual: "${elementText}"`);
}
console.log('Passed: Subject Social and Emotional Learning label matched as expected');
}
},
//Alignment Status title
{
description: 'Validate Alignment Status title',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getText();
if (elementText !== 'Alignment Status') {
throw new Error(`Expected: "Alignment Status" title; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title matched as expected');
}
},
//Alignment Status title font size
{
description: 'Validate Alignment Status title font size',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getCssValue('font-size');
if (elementText !== '13px') {
throw new Error(`Expected: Alignment Status title font size to be "13px"; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status title font size matched as expected');
}
},
//Alignment Status: Not Aligned checkbox
{
description: 'Verify Alignment Status: Not Aligned checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusNot\\ Aligned')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Not Aligned checkbox icon not found');
}
console.log('Passed: Alignment Status Not Aligned checkbox icon present');
}
},
//Not Aligned label
{
description: 'Validate Not Aligned label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(4)')).getText();
if (elementText !== 'Not Aligned') {
throw new Error(`Expected: "Not Aligned"; Actual: "${elementText}"`);
}
console.log('Passed: Not Aligned label matched as expected');
}
},
//Alignment Status: ECS Alignment checkbox
{
description: 'Verify Alignment Status: ECS Alignment checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusECS\\ Alignment')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: ECS Alignment checkbox icon not found');
}
console.log('Passed: Alignment Status ECS Alignment checkbox icon present');
}
},
//ECS Alignment label
{
description: 'Validate ECS Alignment label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(7)')).getText();
if (elementText !== 'ECS Alignment') {
throw new Error(`Expected: "ECS Alignment"; Actual: "${elementText}"`);
}
console.log('Passed: ECS Alignment label matched as expected');
}
},
//Alignment Status: Pending checkbox
{
description: 'Verify Alignment Status: Pending checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusPending')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Pending checkbox icon not found');
}
console.log('Passed: Alignment Status Pending checkbox icon present');
}
},
//Pending label
{
description: 'Validate Pending label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(10)')).getText();
if (elementText !== 'Pending') {
throw new Error(`Expected: "Pending"; Actual: "${elementText}"`);
}
console.log('Passed: Pending label matched as expected');
}
},
//Alignment Status: Aligned checkbox
{
description: 'Verify Alignment Status: Aligned checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusAligned')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Alignment Status: Aligned checkbox icon not found');
}
console.log('Passed: Alignment Status Aligned checkbox icon present');
}
},
//Aligned label
{
description: 'Validate Aligned label',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(13)')).getText();
if (elementText !== 'Aligned') {
throw new Error(`Expected: "Aligned"; Actual: "${elementText}"`);
}
console.log('Passed: Aligned label matched as expected');
}
},
//Reset All label
{
description: 'Validate Reset All label',
action: async () => {
const elementText = await driver.findElement(By.linkText('Reset All')).getText();
if (elementText !== 'Reset All') {
throw new Error(`Expected: Grade: "Reset All" label; Actual: "${elementText}"`);
}
console.log('Passed: Reset All label matched as expected');
}
},
//Home breadcrumb link
{
description: 'Validate Home link',
action: async () => {
const elementText = await driver.findElement(By.linkText('Home')).getText();
if (elementText !== 'Home') {
throw new Error(`Expected: "Home"; Actual: "${elementText}"`);
}
console.log('Passed: Home link matched as expected');
}
},
//Content breadcrumb
{
description: 'Validate Content breadcrumb',
action: async () => {
const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content link matched as expected');
}
},
//Content breadcrumb text color -green
{
description: 'Validate Content breadcrumb text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content breadcrumb text color matched as expected');
}
},
//CONTENT RESULTS - PAGINATION ROW
//Detail View button
{
description: 'Validate Detail View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Detail View')).getText();
if (elementText !== 'Detail View') {
throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Detail View button text matched as expected');
}
},
//Detail View button color -green
{
description: 'Validate Detail View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Detail View button color matched as expected');
}
},
//Edit View button
{
description: 'Validate Edit View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Edit View')).getText();
if (elementText !== 'Edit View') {
throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Edit View button text matched as expected');
}
},
//Edit View button color -green
{
description: 'Validate Edit View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color');
if (elementStyle !== 'rgba(248, 249, 250, 1)') {
throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit View button color matched as expected');
}
},
//Save icon
{
description: 'Verify Save icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.float-right > a:nth-child(1) > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save icon not found');
}
console.log('Passed: Save icon present');
}
},
//Save icon tool-tip
{
description: 'Validate Save icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > div > div.col-xs-12.col-sm-9 > div.float-right.ml-1 > a:nth-child(1)')).getAttribute('title');
if (elementStyle !== 'Save This Search') {
throw new Error(`Expected: "Save This Search"; Actual: "${elementStyle}"`);
}
console.log('Passed: Save This Search tool-tip matched as expected');
}
},
//Print icon
{
description: 'Verify Print icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.icon-link > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Print icon not found');
}
console.log('Passed: Print icon present');
}
},
//Printicon tool-tip
{
description: 'Validate Print icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('.icon-link > img')).getAttribute('title');
if (elementStyle !== 'Print This Page') {
throw new Error(`Expected: "Print This Page"; Actual: "${elementStyle}"`);
}
console.log('Passed: Print This Page tool-tip matched as expected');
}
},
//Filtered Results 1-25 of 1046 label (top)
{
description: 'Validate Filtered Results 1-25 of 1046 label',
action: async () => {
const elementText = await driver.findElement(By.css('.float-left:nth-child(5)')).getText();
if (elementText !== 'Results 1 - 25 of 1046') {
throw new Error(`Expected: Filtered "Results 1 - 25 of 1046" label; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Results 1 - 25 of 1046 label matched as expected');
}
},
//PAGINATION BUTTONS
//Show button text
{
description: 'Validate Show button text',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) #contentlimit')).getText();
if (elementText !== 'Show') {
throw new Error(`Expected: "Show" button text; Actual: "${elementText}"`);
}
console.log('Passed: Show button text matched as expected');
}
},
//Show dropdown [should be: "25", option]
{
description: 'Validate Show dropdown option',
action: async () => {
const elementOption = await driver.findElement(By.css('.form-group:nth-child(6) #inputlimit')).getAttribute('value');
if (elementOption !== '25') {
throw new Error(`Expected: "25"; Actual: "${elementOption}"`);
}
console.log('Passed: Show dropdown option matched as expected');
}
},
//Pagination 1 button text
{
description: 'Validate pagination 1 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('1')).getText();
if (elementText !== '1') {
throw new Error(`Expected: Pagination "1" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 1 button text matched as expected');
}
},
//Pagination 1 background color -green
{
description: 'Validate pagination 1 button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('1')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 1 button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 1 button color matched as expected');
}
},
//Pagination 2 button text
{
description: 'Validate pagination 2 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('2')).getText();
if (elementText !== '2') {
throw new Error(`Expected: Pagination "2" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 2 button text matched as expected');
}
},
//Pagination 2 text color -green
{
description: 'Validate pagination 2 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('2')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 2 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 2 text color matched as expected');
}
},
//Pagination 3 button text
{
description: 'Validate pagination 3 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('3')).getText();
if (elementText !== '3') {
throw new Error(`Expected: Pagination "3" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 3 button text matched as expected');
}
},
//Pagination 3 text color -green
{
description: 'Validate pagination 3 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('3')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 3 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 3 text color matched as expected');
}
},
//Pagination 4 button text
{
description: 'Validate pagination 4 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('4')).getText();
if (elementText !== '4') {
throw new Error(`Expected: Pagination "4" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 4 button text matched as expected');
}
},
//Pagination 4 text color -green
{
description: 'Validate pagination 4 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('4')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 4 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 4 text color matched as expected');
}
},
//Pagination 5 button text
{
description: 'Validate pagination 5 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('5')).getText();
if (elementText !== '5') {
throw new Error(`Expected: Pagination "5" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 5 button text matched as expected');
}
},
//Pagination 5 text color -green
{
description: 'Validate pagination 5 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('5')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 5 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 5 text color matched as expected');
}
},
//Pagination separator icon
{
description: 'Verify Pagination separator icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.linkText('...')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Pagination separator icon not found');
}
console.log('Passed: Pagination separator icon present');
}
},
//Pagination 42 button text
{
description: 'Validate pagination 42 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('42')).getText();
if (elementText !== '42') {
throw new Error(`Expected: Pagination "42" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 42 button text matched as expected');
}
},
//Pagination 42 text color -green
{
description: 'Validate pagination 42 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('42')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 42 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 42 text color matched as expected');
}
},
//Pagination Show All button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Show All')).getText();
if (elementText !== 'Show All') {
throw new Error(`Expected: Pagination "Show All" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination Show All button text matched as expected');
}
},
//Pagination Show All text color -green
{
description: 'Validate pagination Show All text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Show All')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination Show All text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination Show All text color matched as expected');
}
},
//CONTENT RESULTS - CONTENT ITEMS
//Content 1 Title
{
description: 'Validate Content 1 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('AAA My Test III')).getText();
if (elementText !== 'AAA My Test III') {
throw new Error(`Expected: Content 1 item "AAA My Test III" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 item AAA My Test III title matched as expected');
}
},
//Content 1 Title font size
{
description: 'Validate Content 1 item AAA My Test III title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AAA My Test III')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 item "AAA My Test III" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 item AAA My Test III title text font-size matched as expected');
}
},
//Content 1 edit icon
{
description: 'Verify Content 1 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 edit icon not found');
}
console.log('Passed: Content 1 edit icon present');
}
},
//Content 1 edit button text
{
description: 'Validate Content 1 edit button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 1 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 Edit button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 description
{
description: 'Validate Content 1 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText();
if (elementText !== 'Yes, it should work! Perhaps') {
throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 description text matched as expected');
}
},
//Content 1 content set label
{
description: 'Validate Content 1 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 1 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 content set label matched as expected');
}
},
//Content 1 View Details button text
{
description: 'Validate Content 1 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 1 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Details button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 alignment label
{
description: 'Validate Content 1 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 > .display-alignment')).getText();
if (elementText !== 'Aligned (reset)') {
throw new Error(`Expected: Content 1 ECS Alignement label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement label matched as expected');
}
},
//Content 1 alignment reset label
{
description: 'Validate Content 1 ECS Alignement reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 1 ECS Alignement reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label matched as expected');
}
},
//Content 1 alignment reset label font size
{
description: 'Validate Content 1 ECS Alignement reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink874454004 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 ECS Alignement reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label text font-size matched as expected');
}
},
//Content 1 view standards button icon
{
description: 'Verify Content 1 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 View Standards button icon not found');
}
console.log('Passed: Content 1 View Standards button icon present');
}
},
//Content 1 view standards button text
{
description: 'Validate Content 1 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 1 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Standards button text matched as expected');
}
},
//Content 1 view standards button color -green
{
description: 'Validate Content 1 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 View Standards button color matched as expected');
}
},
//Content 2 Title
{
description: 'Validate Content 2 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText();
if (elementText !== 'Abrupt Climate Change') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title matched as expected');
}
},
//Content 2 Title font size
{
description: 'Validate Content 2 item Abrupt Climate Change title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Abrupt Climate Change')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title text font-size matched as expected');
}
},
//Content 2 edit icon
{
description: 'Verify Content 2 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 edit icon not found');
}
console.log('Passed: Content 2 edit icon present');
}
},
//Content 2 edit button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 2 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Edit button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 description
{
description: 'Validate Content 2 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText();
if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') {
throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 description text matched as expected');
}
},
//Content 2 content set label
{
description: 'Validate Content 2 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 2 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 content set label matched as expected');
}
},
//Content 2 View Details button text
{
description: 'Validate Content 2 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 2 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Details button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 alignment label
{
description: 'Validate Content 2 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 > .display-alignment')).getText();
if (elementText !== 'Aligned (reset)') {
throw new Error(`Expected: Content 2 Aligned label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Aligned label matched as expected');
}
},
//Content 2 Alignment Pending reset label
{
description: 'Validate Content 2 Alignement Pending reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 2 Alignement Pending reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Alignement Pending reset label matched as expected');
}
},
//Content 2 Alignment Pending reset label font size
{
description: 'Validate Content 2 Alignment Pending reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink873578650 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 Alignment Pending reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Alignment Pending reset label text font-size matched as expected');
}
},
//Content 2 view standards button icon
{
description: 'Verify Content 2 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 View Standards button icon not found');
}
console.log('Passed: Content 2 View Standards button icon present');
}
},
//Content 2 view standards button text
{
description: 'Validate Content 2 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 2 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Standards button text matched as expected');
}
},
//Content 2 view standards button color -green
{
description: 'Validate Content 2 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 View Standards button color matched as expected');
}
},
//NEXT ACTION - Click Filtered content 2 Edit button
{ description: 'Click filtered countent 2 Edit button', action: async () => await driver.findElement(By.css('.card:nth-child(9) .ml-3')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//NEXT ACTION - Click Concepts/Correlate tab
{ description: 'Click Concepts-Correlate tab', action: async () => await driver.findElement(By.linkText('Concepts/Correlate')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//Tagged Concepts widget title
{
description: 'Validate Tagged Concepts widget title text',
action: async () => {
const elementText = await driver.findElement(By.css('.ui-widget-heading')).getText();
if (elementText !== 'Tagged Concepts:') {
throw new Error(`Expected: "Tagged Concepts:" widget title text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concepts: widget title text matched as expected');
}
},
//Tagged Concepts widget title font size -16px
{
description: 'Validate Tagged Concepts widget title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('.ui-widget-heading')).getCssValue('font-size');
if (elementStyle !== '16px') {
throw new Error(`Expected: "Tagged Concepts:" widget title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concepts: widget title font size matched as expected');
}
},
//Tagged Concept 1 header text
{
description: 'Validate Tagged Concept 1 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')).getText();
if (elementText !== 'Science | Earth Science | Climate') {
throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 header text matched as expected');
}
},
//Tagged concept 1 header text color -gray
{
description: 'Validate Tagged concept 1 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 header text color matched as expected');
}
},
//Tagged Concept 1 remove button icon
{
description: 'Verify Tagged Concept remove button 1 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 1 Remove button icon present');
}
},
//Tagged Concept 1 remove button text
{
description: 'Validate Tagged Concept 1 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k749 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 1 Remove button text matched as expected');
}
},
//Tagged Concept 1 remove button color -red
{
description: 'Validate Tagged Concept 1 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove button color matched as expected');
}
},
//Tagged Concept 1 remove button -tooltip
{
description: 'Validate Tagged Concept 1 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 1 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 1 primary toggle button
{
description: 'Verify Tagged Concept 1 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 1 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 1 Primary toggle button icon present');
}
},
//Tagged Concept 2 header text
{
description: 'Validate Tagged Concept 2 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')).getText();
if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) {
throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 header text matched as expected');
}
},
//Tagged Concept 2 header text color -gray
{
description: 'Validate Tagged Concept 2 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 header text color matched as expected');
}
},
//Tagged Concept 2 remove button icon
{
description: 'Verify Tagged Concept remove button 2 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 2 Remove button icon present');
}
},
//Tagged Concept 2 remove button text
{
description: 'Validate Tagged Concept 2 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k937 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 2 Remove button text matched as expected');
}
},
//Tagged Concept 2 remove button color -red
{
description: 'Validate Tagged Concept 2 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove button color matched as expected');
}
},
//Tagged Concept 2 remove button -tooltip
{
description: 'Validate Tagged Concept 2 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 2 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 2 primary toggle button
{
description: 'Verify Tagged Concept 2 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 2 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 2 Primary toggle button icon present');
}
},
//Tagged Concept 3 header text
{
description: 'Validate Tagged Concept 3 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')).getText();
if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') {
throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 header text matched as expected');
}
},
//Tagged Concept 3 header text color -gray
{
description: 'Validate Tagged Concept 3 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k11532278')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 header text color matched as expected');
}
},
//Tagged Concept 3 remove button icon
{
description: 'Verify Tagged Concept remove button 3 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532278 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 3 Remove button icon present');
}
},
//Tagged Concept 3 remove button text
{
description: 'Validate Tagged Concept 3 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k11532278 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 3 Remove button text matched as expected');
}
},
//Tagged Concept 3 remove button color -red
{
description: 'Validate Tagged Concept 3 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k11532278 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove button color matched as expected');
}
},
//Tagged Concept 3 remove button -tooltip
{
description: 'Validate Tagged Concept 3 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k11532278 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 3 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 3 primary toggle button
{
description: 'Verify Tagged Concept 3 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532278 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 3 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 3 Primary toggle button icon present');
}
},
//Tagged Concept 4 header text
{
description: 'Validate Tagged Concept 4 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')).getText();
if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') {
throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 header text matched as expected');
}
},
//Tagged Concept 4 header text color -gray
{
description: 'Validate Tagged Concept 4 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 header text color matched as expected');
}
},
//Tagged Concept 4 remove button icon
{
description: 'Verify Tagged Concept remove button 4 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 4 Remove button icon present');
}
},
//Tagged Concept 4 remove button text
{
description: 'Validate Tagged Concept 4 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 4 Remove button text matched as expected');
}
},
//Tagged Concept 4 remove button color -red
{
description: 'Validate Tagged Concept 4 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove button color matched as expected');
}
},
//Tagged Concept 4 remove button -tooltip
{
description: 'Validate Tagged Concept 4 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 4 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 4 primary toggle button
{
description: 'Verify Tagged Concept 4 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 4 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 4 Primary toggle button icon present');
}
},
//Tagged Concept 5 header text
{
description: 'Validate Tagged Concept 5 header text',
action: async () => {
const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[5]')).getText();
if (elementText !== 'Science | General') {
throw new Error(`Expected: Tagged Concept 5 header text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 5 header text matched as expected');
}
},
//Tagged Concept 5 header text color -gray
{
description: 'Validate Tagged Concept 5 header text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color');
if (elementStyle !== 'rgba(99, 99, 99, 1)') {
throw new Error(`Expected: Tagged Concept 5 header text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 header text color matched as expected');
}
},
//Tagged Concept 5 remove button icon
{
description: 'Verify Tagged Concept remove button 5 icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 5 "Remove" button icon not found');
}
console.log('Passed: Tagged Concept 5 Remove button icon present');
}
},
//Tagged Concept 5 remove button text
{
description: 'Validate Tagged Concept 5 delete button text',
action: async () => {
const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText();
if (elementText !== 'Remove') {
throw new Error(`Expected: Tagged Concept 5 "Remove" button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Tagged Concept 5 Remove button text matched as expected');
}
},
//Tagged Concept 5 remove button color -red
{
description: 'Validate Tagged Concept 5 remove button label color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(246, 60, 40, 1)') {
throw new Error(`Expected: Tagged Concept 5 "Remove" button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 Remove button color matched as expected');
}
},
//Tagged Concept 5 remove button -tooltip
{
description: 'Validate Tagged Concept 5 remove button tooltip',
action: async () => {
const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title');
if (elementStyle !== 'Remove Concept') {
throw new Error(`Expected: Tagged Concept 5 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Tagged Concept 5 Remove Concept button tooltip matched as expected');
}
},
//Tagged Concept 5 primary toggle button
{
description: 'Verify Tagged Concept 5 primary toggle button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Tagged Concept 5 "Primary" toggle button icon not found');
}
console.log('Passed: Tagged Concept 5 Primary toggle button icon present');
}
},
//RESET CONTENT
//NEXT ACTION - Delete tagged concept (Global Warming)
{
description: 'Click Remove button for Global Warming and validate assert message',
action: async () => {
await driver.sleep(2000);
const removeButton = await driver.wait(
until.elementLocated(By.css('#k11532278 > .btn')),
5000
);
await removeButton.click();
await driver.sleep(2000);
const alert = await driver.wait(
until.alertIsPresent(),
5000
);
const alertText = await alert.getText();
try {
if (alertText !== 'Are you sure you want to delete this?') {
throw new Error(`Expected: "You must select a set of standards"; Actual: "${alertText}"`);
}
console.log('Passed: "Are you sure you want to delete this?" Alert DIV text matched as expected');
console.log('Passed: "OK" button text matched as expected');
} catch (error) {
console.error('FAILED: Alert DIV, unable to validate text; Error Message: ', error.message);
await alert.dismiss();
throw error;
}
await alert.accept();
await driver.sleep(2000);
}
},
//NEXT ACTION - Click Save Changes button
{ description: 'Wait for page to redirect back', action: async () => await driver.sleep(5000) },
{ description: 'Click Save Changes button', action: async () => await driver.findElement(By.css('.submit-content-button')).click() },
//Wait for confirmation bannter to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.msg_success')), 10000).catch(() => false);
}
},
//Page title
{
description: 'Validate Page title',
action: async () => {
const elementText = await driver.findElement(By.css('#myModalLabel')).getText();
if (elementText !== 'Edit Item') {
throw new Error(`Expected: "Edit Item" page title did not match; Actual: "${elementText}"`);
}
console.log('Passed: Edit Item page title matched as expected');
}
},
//Page title color -navy blue
{
description: 'Validate Page title color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Expected: "Edit Item" page title color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title color matched as expected');
}
},
//Page title font size -32px
{
description: 'Validate Page title font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#myModalLabel')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Expected: "Edit Item" page title font size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit Item page title font size matched as expected');
}
},
//Submission confirmation banner text
{
description: 'Validate Submission confirmation banner text',
action: async () => {
const elementText = await driver.findElement(By.css('.msg_success')).getText();
if (elementText !== 'Thank you for your submission! A moderator will review your submission before it is posted.') {
throw new Error(`Expected: Submission confirmation banner text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Submission confirmation banner text displayed as expected');
}
},
//Submission confirmation banner text color -blue
{
description: 'Validate Submission confirmation banner text color',
action: async () => {
const elementValue = await driver.findElement(By.css('.toast-body')).getCssValue('color');
if (elementValue !== 'rgba(40, 167, 69, 1)') {
throw new Error(`Expected: Submission confirmation banner text color did not match; Actual: "${elementValue}"`);
}
console.log('Passed: Submission confirmation banner text color matched as expected');
}
},
//Driver sleep
{ description: 'Wait for action to complete', action: async () => await driver.sleep(5000) },
//Wait for confirmation bannter to load
{
description: 'Wait for page to load',
action: async () => {
return await driver.wait(until.elementLocated(By.linkText('Home')), 10000).catch(() => false);
}
},
//Home breadcrumb link
{
description: 'Validate Home link',
action: async () => {
const elementText = await driver.findElement(By.linkText('Home')).getText();
if (elementText !== 'Home') {
throw new Error(`Expected: "Home"; Actual: "${elementText}"`);
}
console.log('Passed: Home link matched as expected');
}
},
//Content breadcrumb
{
description: 'Validate Content breadcrumb',
action: async () => {
const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText();
if (elementText !== 'Content') {
throw new Error(`Expected: "Content"; Actual: "${elementText}"`);
}
console.log('Passed: Content link matched as expected');
}
},
//Content breadcrumb text color -green
{
description: 'Validate Content breadcrumb text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content breadcrumb text color matched as expected');
}
},
//CONTENT RESULTS - PAGINATION ROW
//Detail View button
{
description: 'Validate Detail View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Detail View')).getText();
if (elementText !== 'Detail View') {
throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Detail View button text matched as expected');
}
},
//Detail View button color -green
{
description: 'Validate Detail View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Detail View button color matched as expected');
}
},
//Edit View button
{
description: 'Validate Edit View button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Edit View')).getText();
if (elementText !== 'Edit View') {
throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`);
}
console.log('Passed: Edit View button text matched as expected');
}
},
//Edit View button color -green
{
description: 'Validate Edit View button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color');
if (elementStyle !== 'rgba(226, 230, 234, 1)') {
throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Edit View button color matched as expected');
}
},
//Save icon
{
description: 'Verify Save icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.float-right > a:nth-child(1) > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Save icon not found');
}
console.log('Passed: Save icon present');
}
},
//Save icon tool-tip
{
description: 'Validate Save icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > div > div.col-xs-12.col-sm-9 > div.float-right.ml-1 > a:nth-child(1)')).getAttribute('title');
if (elementStyle !== 'Save This Search') {
throw new Error(`Expected: "Save This Search"; Actual: "${elementStyle}"`);
}
console.log('Passed: Save This Search tool-tip matched as expected');
}
},
//Print icon
{
description: 'Verify Print icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.icon-link > img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Print icon not found');
}
console.log('Passed: Print icon present');
}
},
//Printicon tool-tip
{
description: 'Validate Print icon tool-tip',
action: async () => {
const elementStyle = await driver.findElement(By.css('.icon-link > img')).getAttribute('title');
if (elementStyle !== 'Print This Page') {
throw new Error(`Expected: "Print This Page"; Actual: "${elementStyle}"`);
}
console.log('Passed: Print This Page tool-tip matched as expected');
}
},
//Filtered Results 1-25 of 1046 label (top)
{
description: 'Validate Filtered Results 1-25 of 1046 label',
action: async () => {
const elementText = await driver.findElement(By.css('.float-left:nth-child(5)')).getText();
if (elementText !== 'Results 1 - 25 of 1046') {
throw new Error(`Expected: Filtered "Results 1 - 25 of 1046" label; Actual: "${elementText}"`);
}
console.log('Passed: Filtered Results 1 - 25 of 1046 label matched as expected');
}
},
//PAGINATION BUTTONS
//Show button text
{
description: 'Validate Show button text',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) #contentlimit')).getText();
if (elementText !== 'Show') {
throw new Error(`Expected: "Show" button text; Actual: "${elementText}"`);
}
console.log('Passed: Show button text matched as expected');
}
},
//Show dropdown [should be: "25", option]
{
description: 'Validate Show dropdown option',
action: async () => {
const elementOption = await driver.findElement(By.css('.form-group:nth-child(6) #inputlimit')).getAttribute('value');
if (elementOption !== '25') {
throw new Error(`Expected: "25"; Actual: "${elementOption}"`);
}
console.log('Passed: Show dropdown option matched as expected');
}
},
//Pagination 1 button text
{
description: 'Validate pagination 1 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('1')).getText();
if (elementText !== '1') {
throw new Error(`Expected: Pagination "1" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 1 button text matched as expected');
}
},
//Pagination 1 background color -green
{
description: 'Validate pagination 1 button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('1')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 1 button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 1 button color matched as expected');
}
},
//Pagination 2 button text
{
description: 'Validate pagination 2 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('2')).getText();
if (elementText !== '2') {
throw new Error(`Expected: Pagination "2" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 2 button text matched as expected');
}
},
//Pagination 2 text color -green
{
description: 'Validate pagination 2 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('2')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 2 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 2 text color matched as expected');
}
},
//Pagination 3 button text
{
description: 'Validate pagination 3 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('3')).getText();
if (elementText !== '3') {
throw new Error(`Expected: Pagination "3" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 3 button text matched as expected');
}
},
//Pagination 3 text color -green
{
description: 'Validate pagination 3 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('3')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 3 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 3 text color matched as expected');
}
},
//Pagination 4 button text
{
description: 'Validate pagination 4 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('4')).getText();
if (elementText !== '4') {
throw new Error(`Expected: Pagination "4" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 4 button text matched as expected');
}
},
//Pagination 4 text color -green
{
description: 'Validate pagination 4 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('4')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 4 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 4 text color matched as expected');
}
},
//Pagination 5 button text
{
description: 'Validate pagination 5 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('5')).getText();
if (elementText !== '5') {
throw new Error(`Expected: Pagination "5" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 5 button text matched as expected');
}
},
//Pagination 5 text color -green
{
description: 'Validate pagination 5 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('5')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 5 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 5 text color matched as expected');
}
},
//Pagination separator icon
{
description: 'Verify Pagination separator icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.linkText('...')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Pagination separator icon not found');
}
console.log('Passed: Pagination separator icon present');
}
},
//Pagination 42 button text
{
description: 'Validate pagination 42 button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('42')).getText();
if (elementText !== '42') {
throw new Error(`Expected: Pagination "42" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination 42 button text matched as expected');
}
},
//Pagination 42 text color -green
{
description: 'Validate pagination 42 text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('42')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination 42 text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination 42 text color matched as expected');
}
},
//Pagination Show All button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Show All')).getText();
if (elementText !== 'Show All') {
throw new Error(`Expected: Pagination "Show All" button text; Actual: "${elementText}"`);
}
console.log('Passed: Pagination Show All button text matched as expected');
}
},
//Pagination Show All text color -green
{
description: 'Validate pagination Show All text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Show All')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Pagination Show All text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Pagination Show All text color matched as expected');
}
},
//CONTENT RESULTS - CONTENT ITEMS
//Content 1 Title
{
description: 'Validate Content 1 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('AAA My Test III')).getText();
if (elementText !== 'AAA My Test III') {
throw new Error(`Expected: Content 1 item "AAA My Test III" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 item AAA My Test III title matched as expected');
}
},
//Content 1 Title font size
{
description: 'Validate Content 1 item AAA My Test III title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('AAA My Test III')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 item "AAA My Test III" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 item AAA My Test III title text font-size matched as expected');
}
},
//Content 1 edit icon
{
description: 'Verify Content 1 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 edit icon not found');
}
console.log('Passed: Content 1 edit icon present');
}
},
//Content 1 edit button text
{
description: 'Validate Content 1 edit button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 1 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 Edit button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 description
{
description: 'Validate Content 1 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText();
if (elementText !== 'Yes, it should work! Perhaps') {
throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 description text matched as expected');
}
},
//Content 1 content set label
{
description: 'Validate Content 1 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 1 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 content set label matched as expected');
}
},
//Content 1 View Details button text
{
description: 'Validate Content 1 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 1 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Details button text matched as expected');
}
},
//Content 1 edit button color -green
{
description: 'Validate Content 1 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 Edit button color matched as expected');
}
},
//Content 1 alignment label
{
description: 'Validate Content 1 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 > .display-alignment')).getText();
if (elementText !== 'Aligned (reset)') {
throw new Error(`Expected: Content 1 ECS Alignement label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement label matched as expected');
}
},
//Content 1 alignment reset label
{
description: 'Validate Content 1 ECS Alignement reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink874454004 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 1 ECS Alignement reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label matched as expected');
}
},
//Content 1 alignment reset label font size
{
description: 'Validate Content 1 ECS Alignement reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink874454004 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 1 ECS Alignement reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 ECS Alignement reset label text font-size matched as expected');
}
},
//Content 1 view standards button icon
{
description: 'Verify Content 1 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 1 View Standards button icon not found');
}
console.log('Passed: Content 1 View Standards button icon present');
}
},
//Content 1 view standards button text
{
description: 'Validate Content 1 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 1 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 1 View Standards button text matched as expected');
}
},
//Content 1 view standards button color -green
{
description: 'Validate Content 1 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 1 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 1 View Standards button color matched as expected');
}
},
//Content 2 Title
{
description: 'Validate Content 2 title',
action: async () => {
const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText();
if (elementText !== 'Abrupt Climate Change') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" title; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title matched as expected');
}
},
//Content 2 Title font size
{
description: 'Validate Content 2 item Abrupt Climate Change title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Abrupt Climate Change')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 item "Abrupt Climate Change" text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 item Abrupt Climate Change title text font-size matched as expected');
}
},
//Content 2 edit icon
{
description: 'Verify Content 2 edit icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .lo-title .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 edit icon not found');
}
console.log('Passed: Content 2 edit icon present');
}
},
//Content 2 edit button text
{
description: 'Validate pagination Show All button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getText();
if (elementText !== 'Edit') {
throw new Error(`Expected: Content 2 "Edit" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Edit button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 description
{
description: 'Validate Content 2 description',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText();
if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') {
throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 description text matched as expected');
}
},
//Content 2 content set label
{
description: 'Validate Content 2 content set label',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) small')).getText();
if (elementText !== 'Content Set: Biology - QA') {
throw new Error(`Expected: Content 2 content set label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 content set label matched as expected');
}
},
//Content 2 View Details button text
{
description: 'Validate Content 2 View Details button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getText();
if (elementText !== 'View Details') {
throw new Error(`Expected: Content 2 "View Details" button text; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Details button text matched as expected');
}
},
//Content 2 edit button color -green
{
description: 'Validate Content 2 Edit button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) > .card-body > div > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Edit button color matched as expected');
}
},
//Content 2 alignment label
{
description: 'Validate Content 2 ECS Alignement label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 > .display-alignment')).getText();
if (elementText !== 'Alignment Pending (reset)') {
throw new Error(`Expected: Content 2 Aligned label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Aligned label matched as expected');
}
},
//Content 2 Alignment Pending reset label
{
description: 'Validate Content 2 Alignement Pending reset label',
action: async () => {
const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getText();
if (elementText !== 'reset') {
throw new Error(`Expected: Content 2 Alignement Pending reset label did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 Alignement Pending reset label matched as expected');
}
},
//Content 2 Alignment Pending reset label font size
{
description: 'Validate Content 2 Alignment Pending reset label text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#alignstatuslink873578650 b')).getCssValue('font-size');
if (elementStyle !== '13px') {
throw new Error(`Expected: Content 2 Alignment Pending reset label text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 Alignment Pending reset label text font-size matched as expected');
}
},
//Content 2 view standards button icon
{
description: 'Verify Content 2 View Standards button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .well .fa')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Expected: Content 2 View Standards button icon not found');
}
console.log('Passed: Content 2 View Standards button icon present');
}
},
//Content 2 view standards button text
{
description: 'Validate Content 2 View Standards button text',
action: async () => {
const elementText = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getText();
if (elementText !== 'View Standards') {
throw new Error(`Expected: Content 2 View Standards button text did not match; Actual: "${elementText}"`);
}
console.log('Passed: Content 2 View Standards button text matched as expected');
}
},
//Content 2 view standards button color -green
{
description: 'Validate Content 2 view standards button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Expected: Content 2 View Standards button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Content 2 View Standards button color matched as expected');
}
},
//LOG OUT
//NEXT ACTION - Log out
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
{ description: 'Wait action to complete', action: async () => await driver.sleep(2000) },
//Log Out icon
{
description: 'Verify Log Out icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-sign-out')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Log Out icon not found');
}
console.log('Passed: Log Out icon present');
}
},
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
//Wait for login screen to load
{
description: 'Wait for log out process to complete',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
}
},
//Log Out button
{
description: 'Verify Log Out button is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Log Out button not found');
}
console.log('Passed: Log Out button present; Script completed');
}
},
];
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]);
return XLSX.utils.aoa_to_sheet(json_data);
};
const takeScreenshot = async (driver, stepIndex, stepDescription) => {
const screenshot = await driver.takeScreenshot();
const dir = path.join('screenshots', 'editItemAddConcept');
const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`;
const screenshotPath = path.join(dir, screenshotFileName);
fs.writeFileSync(screenshotPath, screenshot, 'base64');
return screenshotPath;
};
const clearOldResults = () => {
// Remove old screenshots
const screenshotDir = path.join('screenshots', 'editItemAddConcept');
if (fs.existsSync(screenshotDir)) {
fs.rmSync(screenshotDir, { recursive: true, force: true });
}
fs.mkdirSync(screenshotDir, { recursive: true });
// Remove old Excel file
if (fs.existsSync('editItemAddConceptResults.xlsx')) {
fs.unlinkSync('editItemAddConceptResults.xlsx');
}
};
try {
// Initialize workbook and worksheet
clearOldResults();
// Initialize workbook and worksheet
workbook = XLSX.utils.book_new();
worksheet = XLSX.utils.aoa_to_sheet([
['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot']
]);
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
// Log test start time
worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, '');
let allStepsPassed = true;
for (const step of steps) {
const stepIndex = steps.indexOf(step) + 1;
const timestamp = new Date().toISOString();
try {
await step.action();
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
} catch (error) {
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
testStatus = 'Failed';
allStepsPassed = false;
}
}
//Check if log out was successful
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
if (loginButton && allStepsPassed) {
console.log('PASSED: Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); All test steps completed successfully');
testStatus = 'Passed';
} else {
console.log('FAILED: Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); One or more test steps failed');
testStatus = 'Failed';
}
// Log test end time
const endTime = new Date().toISOString();
worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, '');
// Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'editItemAddConceptResults.xlsx');
} finally {
await driver.quit();
}
})();
}
export default ExACT_editItemAddConcept;