Added split row validation fix
This commit is contained in:
Binary file not shown.
@@ -1028,19 +1028,7 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Biology - QA Total Items label
|
//Biology - QA Total Items Count "1046"
|
||||||
{
|
|
||||||
description: 'Validate Biology - QA Totals DIV - Total Items label',
|
|
||||||
action: async () => {
|
|
||||||
const elementText = await driver.findElement(By.css('#total')).getText();
|
|
||||||
if (elementText !== 'My Content Totals') {
|
|
||||||
throw new Error(`Expected: "My Content Totals"; Actual: "${elementText}"`);
|
|
||||||
}
|
|
||||||
console.log('Passed: Biology - QA Totals DIV - Total Items label matched as expected');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
//Biology - QA Total Items Count "1046"?
|
|
||||||
{
|
{
|
||||||
description: 'Validate Biology - QA Totals DIV - Total Items Count',
|
description: 'Validate Biology - QA Totals DIV - Total Items Count',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
@@ -1048,7 +1036,7 @@ const steps = [
|
|||||||
if (elementText !== '1046') {
|
if (elementText !== '1046') {
|
||||||
throw new Error(`Expected: "1046"; Actual: "${elementText}"`);
|
throw new Error(`Expected: "1046"; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Biology - QA Totals DIV - Total Items Count matched as expected');
|
console.log('Passed: 1046 - Total Items Count matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1064,15 +1052,38 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Biology - QA Unique Titles label
|
//Biology - QA Total Items label
|
||||||
{
|
{
|
||||||
description: 'Validate Biology - QA Totals DIV - Unique Titles label',
|
description: 'Validate Biology - QA Totals DIV - Total Items label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('#total_titles')).getText();
|
try {
|
||||||
if (elementText !== 'Unique Titles') {
|
const element = await driver.findElement(By.css('#total'));
|
||||||
throw new Error(`Expected: "Unique Titles"; Actual: "${elementText}"`);
|
|
||||||
|
//Get different versions of the text for debugging
|
||||||
|
const fullText = await element.getText();
|
||||||
|
|
||||||
|
//Check for the expected text in different ways
|
||||||
|
const expectedText = 'Total Items';
|
||||||
|
const trimmedFullText = fullText.trim();
|
||||||
|
const firstLine = trimmedFullText.split('\n')[0].trim();
|
||||||
|
|
||||||
|
//Try multiple matching strategies
|
||||||
|
if (firstLine.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text in first line`);
|
||||||
|
} else if (trimmedFullText.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text within full text`);
|
||||||
|
} else {
|
||||||
|
throw new Error(
|
||||||
|
`Text validation failed.\nExpected: "${expectedText}"\n` +
|
||||||
|
`Full text: "${fullText}"\n` +
|
||||||
|
`First line: "${firstLine}"\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Detailed error during validation:', error);
|
||||||
|
throw error; //Re-throw after logging
|
||||||
}
|
}
|
||||||
console.log('Passed: Biology - QA Totals DIV - Unique Titles label matched as expected');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1100,15 +1111,38 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Biology - QA Unique IDs label
|
//Biology - QA Unique Titles label
|
||||||
{
|
{
|
||||||
description: 'Validate Biology - QA Totals DIV - Unique IDs',
|
description: 'Validate Biology - QA Totals DIV - Unique Titles label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('#total_pubtotalids')).getText();
|
try {
|
||||||
if (elementText !== 'Unique IDs') {
|
const element = await driver.findElement(By.css('#total_titles'));
|
||||||
throw new Error(`Expected: "Unique IDs"; Actual: "${elementText}"`);
|
|
||||||
|
//Get different versions of the text for debugging
|
||||||
|
const fullText = await element.getText();
|
||||||
|
|
||||||
|
//Check for the expected text in different ways
|
||||||
|
const expectedText = 'Unique Titles';
|
||||||
|
const trimmedFullText = fullText.trim();
|
||||||
|
const firstLine = trimmedFullText.split('\n')[0].trim();
|
||||||
|
|
||||||
|
//Try multiple matching strategies
|
||||||
|
if (firstLine.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text in first line`);
|
||||||
|
} else if (trimmedFullText.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text within full text`);
|
||||||
|
} else {
|
||||||
|
throw new Error(
|
||||||
|
`Text validation failed.\nExpected: "${expectedText}"\n` +
|
||||||
|
`Full text: "${fullText}"\n` +
|
||||||
|
`First line: "${firstLine}"\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Detailed error during validation:', error);
|
||||||
|
throw error; //Re-throw after logging
|
||||||
}
|
}
|
||||||
console.log('Passed: Biology - QA Totals DIV - Unique IDs label matched as expected');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1136,6 +1170,41 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//Biology - QA Unique IDs label
|
||||||
|
{
|
||||||
|
description: 'Validate Biology - QA Totals DIV - Unique IDs',
|
||||||
|
action: async () => {
|
||||||
|
try {
|
||||||
|
const element = await driver.findElement(By.css('#total_pubtotalids'));
|
||||||
|
|
||||||
|
//Get different versions of the text for debugging
|
||||||
|
const fullText = await element.getText();
|
||||||
|
|
||||||
|
//Check for the expected text in different ways
|
||||||
|
const expectedText = 'Unique IDs';
|
||||||
|
const trimmedFullText = fullText.trim();
|
||||||
|
const firstLine = trimmedFullText.split('\n')[0].trim();
|
||||||
|
|
||||||
|
//Try multiple matching strategies
|
||||||
|
if (firstLine.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text in first line`);
|
||||||
|
} else if (trimmedFullText.includes(expectedText)) {
|
||||||
|
console.log(`Passed: "${expectedText}" text within full text`);
|
||||||
|
} else {
|
||||||
|
throw new Error(
|
||||||
|
`Text validation failed.\nExpected: "${expectedText}"\n` +
|
||||||
|
`Full text: "${fullText}"\n` +
|
||||||
|
`First line: "${firstLine}"\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Detailed error during validation:', error);
|
||||||
|
throw error; //Re-throw after logging
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//My Content; My Content Totals DIV - Close button
|
//My Content; My Content Totals DIV - Close button
|
||||||
{
|
{
|
||||||
description: 'Validate My Content Totals DIV - Close button',
|
description: 'Validate My Content Totals DIV - Close button',
|
||||||
|
|||||||
Reference in New Issue
Block a user