Added Export Content checks

This commit is contained in:
2024-12-09 13:33:34 -08:00
parent 4b9072a970
commit e2f34bd7e6

View File

@@ -45,7 +45,7 @@ const steps = [
}
},
//Dashboard title text color -navy blue
//Dashboard title text color -dark blue
{
description: 'Validate dashboard title text color',
action: async () => {
@@ -82,7 +82,7 @@ const steps = [
}
},
//Dashboard My Content Widget title text color -navy blue
//Dashboard My Content Widget title text color -dark blue
{
description: 'Validate dashboard My Content widget title text color',
action: async () => {
@@ -118,7 +118,7 @@ const steps = [
}
},
//Dashboard My Content Item Count button color -navy blue
//Dashboard My Content Item Count button color -dark blue
{
description: 'Validate Dashboard My Content Item Count button color',
action: async () => {
@@ -142,7 +142,7 @@ const steps = [
}
},
//Ellipsis icon color -navy blue
//Ellipsis icon color -dark blue
{
description: 'Validate ellipsis icon color',
action: async () => {
@@ -262,7 +262,7 @@ const steps = [
}
},
//My Content Totals DIV title text color -navy blue
//My Content Totals DIV title text color -dark blue
{
description: 'Validate My Content Totals DIV title font color',
action: async () => {
@@ -526,9 +526,10 @@ const steps = [
}
},
//Click Close DIV button
//Close DIV button
{ description: 'Click My Contents Count DIV Close button', action: async () => await driver.findElement(By.css('#all_content_modal .btn-secondary')).click() },
{ description: 'Wait for My Content Totals DIV to close', action: async () => await driver.sleep(2000) },
//EDIT BIOLOGY - QA CONTENT SET
{ description: 'Click Biology-QA edit icon', action: async () => await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .fa')).click() },
{ description: 'Wait for Edit Content DIV to open', action: async () => await driver.sleep(5000) },
@@ -676,6 +677,7 @@ const steps = [
//Close edit DIV
{ description: 'Click X icon', action: async () => await driver.findElement(By.css('.modal-lg .modal-header span')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
//BIOLOGY - QA ITEM COUNT CHECK
//Verify Biology - QA item Count
{ description: 'Click Biology-QA item Count link', action: async () => await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .badge')).click() },
@@ -701,7 +703,7 @@ const steps = [
}
},
//Biology - QA Totals DIV title text color -navy blue
//Biology - QA Totals DIV title text color -dark blue
{
description: 'Validate Biology - QA Totals DIV title font color',
action: async () => {
@@ -872,7 +874,8 @@ const steps = [
//Click Close DIV button
{ description: 'Click My Contents Count DIV Close button', action: async () => await driver.findElement(By.css('#all_content_modal .btn-secondary')).click() },
{ description: 'Wait for My Content Totals DIV to close', action: async () => await driver.sleep(2000) },
//CREATE CONTENT SET
//Click My Content ellipsis icon
{ description: 'Click Ellipsis icon', action: async () => await driver.findElement(By.css('.fa-ellipsis-h')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
@@ -948,6 +951,7 @@ const steps = [
}
},
//CREATE CONTENT SET
{ description: 'Click Create Content Set link', action: async () => await driver.findElement(By.linkText('Create Content Set')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(5000) },
@@ -1031,7 +1035,7 @@ const steps = [
}
},
//Click Create button - without Content Set Name
//Create Content Set Validation - No Name
{ description: 'Click create button without content set name', action: async () => await driver.findElement(By.css('.modal-lg #modalop')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
@@ -1059,7 +1063,7 @@ const steps = [
}
},
//Enter duplicate Content Set name
//Create Content Set Validation - Existing Name
{ description: 'Enter existing content set name', action: async () => await driver.findElement(By.css('#orgname')).sendKeys('Biology - QA') },
{ description: 'Click create button', action: async () => await driver.findElement(By.css('.modal-lg #modalop')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
@@ -1140,7 +1144,7 @@ const steps = [
},
//ITEMS PAGE
//Click created content set
//Click created content set link
{ description: 'Click created content set title link', action: async () => await driver.findElement(By.linkText(createContentSetName)).click() },
//Wait for DIV
@@ -1223,7 +1227,542 @@ const steps = [
}
},
//DELETE CREATED CONTENT SET
//EXPORT CONTENT
{ description: 'Click Ellipsis icon', action: async () => await driver.findElement(By.css('.fa-ellipsis-h')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
//Create Content Set icon color -dark blue
{
description: 'Validate create content set icon color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.fa-plus')).getCssValue('color');
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
throw new Error(`Create Content Set icon color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Create Content Set icon color matched as expected');
}
},
//Create Content Set link text
{
description: 'Validate create content set link text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Create Content Set')).getText();
if (elementText !== 'Create Content Set') {
throw new Error(`Expected: "Create Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Create Content Set link text matched as expected');
}
},
//Create Content Set link text color -dark blue
{
description: 'Validate create content set link text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Create Content Set')).getCssValue('color');
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
throw new Error(`Create Content Set link text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Create Content Set link text color matched as expected');
}
},
//Export Content Set icon color -dark blue
{
description: 'Validate export content set icon color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.fa-download')).getCssValue('color');
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
throw new Error(`Export Content icon color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export Content icon color matched as expected');
}
},
//Export Content Set link text
{
description: 'Validate export content set link text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Export Content Set')).getText();
if (elementText !== 'Export Content Set') {
throw new Error(`Expected: "Export Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Export Content Set link text matched as expected');
}
},
//Export Content Set link text color -dark blue
{
description: 'Validate export content set link text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Export Content Set')).getCssValue('color');
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
throw new Error(`Export Content Set icon color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export Content Set icon color matched as expected');
}
},
//Click Export Content Set link
{ description: 'Click Export Content Set link', action: async () => await driver.findElement(By.linkText('Export Content Set')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
//Wait for dashboard to load
{
description: 'Wait for DIV to open',
action: async () => {
return await driver.wait(until.elementLocated(By.css('.modal-header:nth-child(4) > .modal-title')), 10000).catch(() => false);
}
},
//Export Content Set DIV
{
description: 'Validate export content set DIV title',
action: async () => {
const elementText = await driver.findElement(By.css('.modal-header:nth-child(4) > .modal-title')).getText();
if (elementText !== 'Export Content') {
throw new Error(`Export set DIV title did not match; Actual: "${elementText}"`);
}
console.log('Passed: Export Content DIV title matched as expected');
}
},
//Export Content Set DIV - title
{
description: 'Validate export DIV title text',
action: async () => {
const elementText = await driver.findElement(By.css('#content-export-container > h5')).getText();
if (elementText !== 'Please select one or more content sets to export:') {
throw new Error(`Expected: "Please select one or more content sets to export:"; Actual: "${elementText}"`);
}
console.log('Passed: Export Content DIV title matched as expected');
}
},
//Export Content Set DIV - title
{
description: 'Validate export DIV title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('#content-export-container > h5')).getCssValue('font-size');
if (elementStyle !== '20px') {
throw new Error(`Export Content title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export Content title text font-size matched as expected');
}
},
//Export Content Set DIV - label
{
description: 'Validate export DIV label',
action: async () => {
const elementText = await driver.findElement(By.css('#content_export .form-label')).getText();
if (elementText !== 'Content Set') {
throw new Error(`Expected: "Content Set"; Actual: "${elementText}"`);
}
console.log('Passed: Export Content DIV label matched as expected');
}
},
//Export Content Set Dropdown
{
description: 'Validate export content set dropdown option',
action: async () => {
const elementOption = await driver.findElement(By.css('.form-group:nth-child(1) .multiselect-selected-text')).getText();
if (elementOption !== 'Please select a Content Set') {
throw new Error(`Expected: "Please select a Content Set"; Actual: "${elementOption}"`);
}
console.log('Passed: Export Content Set dropdown option matched as expected');
}
},
//Export Content Set DIV - Export button text
{
description: 'Validate export DIV - Export button text',
action: async () => {
const elementText = await driver.findElement(By.css('.modal-footer:nth-child(6) > .btn-primary')).getAttribute('value');
if (elementText !== 'Export') {
throw new Error(`Expected: "Export"; Actual: "${elementText}"`);
}
console.log('Passed: Export button text matched as expected');
}
},
//Export Content Set DIV - Export button color -green
{
description: 'Validate export DIV - Export button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.modal-footer:nth-child(6) > .btn-primary')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Export button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export button color matched as expected');
}
},
//Export Content Set DIV - Close button text
{
description: 'Validate export DIV - Close button text',
action: async () => {
const elementText = await driver.findElement(By.css('.btn:nth-child(3)')).getText();
if (elementText !== 'Close') {
throw new Error(`Expected: "Close"; Actual: "${elementText}"`);
}
console.log('Passed: Close DIV label matched as expected');
}
},
//Export Content Set DIV - Close button color -white
{
description: 'Validate export DIV - Close button color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.btn:nth-child(3)')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Close button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Close button color matched as expected');
}
},
//Click dropdown
{ description: 'Click Export Content dropdown', action: async () => await driver.findElement(By.css('.form-group:nth-child(1) .multiselect-selected-text')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
//Export search icon
{
description: 'Verify export search icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show .input-group-prepend img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export search icon not found');
}
console.log('Passed: Export search icon present');
}
},
//Export Content set dropdown placeholder
{
description: 'Validate dropdown placeholder text',
action: async () => {
const elementValue = await driver.findElement(By.css('.show > .multiselect-item .form-control')).getAttribute('placeholder');
if (elementValue !== 'Search') {
throw new Error(`Expected: "Search"; Actual: "${elementValue}"`);
}
console.log('Passed: Export dropdown placeholder text matched as expected');
}
},
//Export X icon
{
description: 'Verify export search X icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.form-group:nth-child(1) .input-group-append img')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export search X icon not found');
}
console.log('Passed: Export search X icon present');
}
},
//SEARCH OPTIONS
//Select All checkbox
{
description: 'Verify Select all checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show .multiselect-all input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export selectd all checkbox icon not found');
}
console.log('Passed: Export select all checkbox icon present');
}
},
//Select all searcch text
{
description: 'Validate export Select all text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > .multiselect-item .checkbox')).getText();
if (elementText !== 'Select all') {
throw new Error(`Expected: "Select all"; Actual: "${elementText}"`);
}
console.log('Passed: Select all matched as expected');
}
},
//Filter content list by QA
{ description: 'Filter Content Set Search list by QA', action: async () => await driver.findElement(By.css('.show > .multiselect-item .form-control')).sendKeys('QA') },
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
//FILTERED RESULTS
//Select All checkbox
{
description: 'Verify Select all checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show .multiselect-all input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export selectd all checkbox icon not found');
}
console.log('Passed: Export select all checkbox icon present');
}
},
//Select all searcch handle text
{
description: 'Validate export Select all handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > .multiselect-item .checkbox')).getText();
if (elementText !== 'Select all') {
throw new Error(`Expected: "Select all"; Actual: "${elementText}"`);
}
console.log('Passed: Select all handle text matched as expected');
}
},
//Algebra - QA checkbox
{
description: 'Verify Algebra checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(8) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export Algebra - QA checkbox icon not found');
}
console.log('Passed: Export Algebra - QA checkbox icon present');
}
},
//Algebra - QA searcch handle text
{
description: 'Validate export Algebra handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(8) .checkbox')).getText();
if (elementText !== 'Algebra - QA') {
throw new Error(`Expected: "Algebra - QA"; Actual: "${elementText}"`);
}
console.log('Passed: Algebra - QA handle text matched as expected');
}
},
//Biology - QA checkbox
{
description: 'Verify Biology checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(9) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export Biology - QA checkbox icon not found');
}
console.log('Passed: Export Biology - QA checkbox icon present');
}
},
//Biology - QA searcch handle text
{
description: 'Validate export Biology handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(9) .checkbox')).getText();
if (elementText !== 'Biology - QA') {
throw new Error(`Expected: "Biology - QA"; Actual: "${elementText}"`);
}
console.log('Passed: Biology - QA handle text matched as expected');
}
},
//English II - QA checkbox
{
description: 'Verify English II checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(10) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export English II - QA checkbox icon not found');
}
console.log('Passed: Export English II - QA checkbox icon present');
}
},
//English II - QA searcch handle text
{
description: 'Validate export English II handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(10) .checkbox')).getText();
if (elementText !== 'English II - QA') {
throw new Error(`Expected: "English II - QA"; Actual: "${elementText}"`);
}
console.log('Passed: English II - QA handle text matched as expected');
}
},
//Geometry - QA checkbox
{
description: 'Verify Geometry checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(11) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export Geometry - QA checkbox icon not found');
}
console.log('Passed: Export Geometry - QA checkbox icon present');
}
},
//Geometry - QA searcch handle text
{
description: 'Validate export Geometry handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(11) .checkbox')).getText();
if (elementText !== 'Geometry - QA') {
throw new Error(`Expected: "Geometry - QA"; Actual: "${elementText}"`);
}
console.log('Passed: Geometry - QA handle text matched as expected');
}
},
//US History - QA checkbox
{
description: 'Verify US History checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(12) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export US History - QA checkbox icon not found');
}
console.log('Passed: Export US History - QA checkbox icon present');
}
},
//US History - QA searcch handle text
{
description: 'Validate export US History handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(12) .checkbox')).getText();
if (elementText !== 'US History - QA') {
throw new Error(`Expected: "US History - QA"; Actual: "${elementText}"`);
}
console.log('Passed: US History - QA handle text matched as expected');
}
},
//Automated - QA Content Set - To be deleted checkbox
{
description: 'Verify Automated - QA Content Set - To be deleted checkbox icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(19) input')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Export Automated - QA Content Set - To be deleted checkbox icon not found');
}
console.log('Passed: Export Automated - QA Content Set - To be deleted checkbox icon present');
}
},
//Automated - QA Content Set - To be deleted searcch handle text
{
description: 'Validate export Automated - QA Content Set - To be deleted handle text',
action: async () => {
const elementText = await driver.findElement(By.css('.show > li:nth-child(19) .checkbox')).getText();
if (elementText !== 'Automated - QA Content Set - To be deleted') {
throw new Error(`Expected: "Automated - QA Content Set - To be deleted"; Actual: "${elementText}"`);
}
console.log('Passed: Automated - QA Content Set - To be deleted handle text matched as expected');
}
},
//Select created content set to export
{ description: 'Click Automated QA checkbox', action: async () => await driver.findElement(By.css('.show > li:nth-child(19) input')).click() },
{ description: 'Wait for login process to complete', action: async () => await driver.sleep(2000) },
{ description: 'Click Export button', action: async () => await driver.findElement(By.css('.modal-footer:nth-child(6) > .btn-primary')).click() },
{ description: 'Wait for export page to load', action: async () => await driver.sleep(5000) },
//Export page title
{
description: 'Validate Export page title',
action: async () => {
const elementText = await driver.findElement(By.css('h2')).getText();
if (elementText !== 'Export') {
throw new Error(`Expected: "Export"; Actual: "${elementText}"`);
}
console.log('Passed: Export page title matched as expected');
}
},
//Export page title text color -dark blue
{
description: 'Validate Export page title text font color',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Export page title text font color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export page title text font color matched as expected');
}
},
//Export page title text size
{
description: 'Validate Export page title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Export page title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Export page title text font-size matched as expected');
}
},
//Export complete label
{
description: 'Validate Export complete label',
action: async () => {
const elementText = await driver.findElement(By.css('b')).getText();
if (elementText !== 'Export complete!') {
throw new Error(`Expected: "Export complete!"; Actual: "${elementText}"`);
}
console.log('Passed: Export complete! label matched as expected');
}
},
//Download Export button icon
{
description: 'Verify Download Export button icon is present',
action: async () =>
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-download')), 5000).catch(() => false);
if (!expectedIcon) {
throw new Error('Download Export button icon not found');
}
console.log('Passed: Download Export button icon present');
}
},
//Download Export button text
{
description: 'Validate Download Export button text',
action: async () => {
const elementText = await driver.findElement(By.linkText('Download Export')).getText();
if (elementText !== 'Download Export') {
throw new Error(`Expected: "Download Export"; Actual: "${elementText}"`);
}
console.log('Passed: Download Export button text matched as expected');
}
},
//Download Export button color -dark blue
{
description: 'Validate Download Export button color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Download Export')).getCssValue('background-color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Download Export button color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Download Export button color matched as expected');
}
},
//NAVIGATE BACK TO DASHBOARD
{ description: 'Click Dashboard navigation link', action: async () => await driver.findElement(By.linkText('Dashboard')).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);
}
},
//Filter content list by - QA
{ description: 'Enter content set name', action: async () => await driver.findElement(By.css('#content-org-filter')).sendKeys('QA') },
{ description: 'Wait for content list to filter', action: async () => await driver.sleep(2000) },
@@ -1360,16 +1899,10 @@ const steps = [
}
},
//Delete content item
//Click Delete content button
{ description: 'Click Delete button', action: async () => await driver.findElement(By.css('#orgdelete')).click() },
{ description: 'Driver sleep', action: async () => await driver.sleep(5000) },
//NEED TO READ ALERT MESSAGE AND CLICK OK TO DELETE CONTENT
];