Updated dropdown text check

This commit is contained in:
2025-01-17 10:47:56 -08:00
parent 65960e8f36
commit 8c58dab5c1

View File

@@ -340,6 +340,18 @@ const steps = [
}
},
//Grade dropdown value
{
description: 'Validate Grade dropdown value',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(1) .multiselect-selected-text')).getText();
if (elementText !== 'None selected') {
throw new Error(`Expected: Grade: "None selected" dropdown value did not match; Actual: "${elementText}"`);
}
console.log('Passed: Grade: None selected dropdown value matched as expected');
}
},
//Subject:
{
description: 'Validate Subject label',
@@ -352,6 +364,18 @@ const steps = [
}
},
//Subject dropdown value
{
description: 'Validate Subject dropdown value',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) .multiselect-selected-text')).getText();
if (elementText !== 'None selected') {
throw new Error(`Expected: Subject: "None selected" dropdown value did not match; Actual: "${elementText}"`);
}
console.log('Passed: Subject: None selected dropdown value matched as expected');
}
},
//Alignment Status:
{
description: 'Validate Alignment Status label',
@@ -364,6 +388,18 @@ const steps = [
}
},
//Alignment Status dropdown value
{
description: 'Validate Alignment Status dropdown value',
action: async () => {
const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) .multiselect-selected-text')).getText();
if (elementText !== 'None selected') {
throw new Error(`Expected: Alignment Status: "None selected" dropdown value did not match; Actual: "${elementText}"`);
}
console.log('Passed: Alignment Status: None selected dropdown value matched as expected');
}
},
//NEXT ACTION - Click Grade dropdown
{ description: 'Click Grade dropdown', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(1) .multiselect')).click() },
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },