Recently, I conducted a test to determine the number of breadcrumbs appearing on a specific website:
The website in question is:
The 2 breadcrumbs (highlighted in blue circle): breadcrumbs_screenshot
This was my testing approach: (with '[itemprop="item"]' as the CSS selector for breadcrumbs button)
it.only('Upper display shows the breadcrumbs', function () {
let breadcrumbsAppearancesNumber = $$('[itemprop="item"]').length;
expect(breadcrumbsAppearancesNumber).to.equal(2);
});
When tested with 2 breadcrumbs, the results were accurate.
However, out of curiosity, when I altered the test to check for 3 breadcrumbs:
it.only('Upper display shows the breadcrumbs', function () {
let breadcrumbsAppearancesNumber = $$('[itemprop="item"]').length;
expect(breadcrumbsAppearancesNumber).to.equal(3);
});
The test understandably failed, producing an output of "npm ERR! Test failed. See above for more details."
Upon reviewing the error messages, I couldn't find any additional information explaining why it failed...
The console displayed:
Stdout:
[Details of browser commands and operations]
Test Suites: 0 passed, 1 failed, 1 total (100% completed)
Time: 🕑 13.05s
npm ERR! Test failed. See above for more details.
Any insights on what might have caused this issue would be greatly appreciated!
Thank you!