Skip to content

Commit

Permalink
SBVT-1235: Fixing logs (#63)
Browse files Browse the repository at this point in the history
* SBVT-1235: Fixing some logs

* SBVT-1235: Fixing some logs

---------

Co-authored-by: trevor.nelms <trevor.nelms@smartbear.com>
  • Loading branch information
tnelms1 and trevor.nelms authored Mar 28, 2023
1 parent 7a07007 commit 6837d15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,17 @@ let takeScreenshot = (element, name, modifiedOptions) => {

if (numScrolls <= 1) {
// Check if the webpage is not scrollable
cy.task('logger', {type: 'warn', message: `the webpage is not scrollable, not able to lazyload "${imageName}", taking regular screenshot`});
if (modifiedOptions.lazyload) {
// Warn if the webpage is not scrollable, and user is trying to lazyload
cy.task('logger', {type: `warn`, message: `the webpage is not scrollable, not able to lazyload "${imageName}", taking regular screenshot`});
}
else {
// No need to throw warning if not lazyload
cy.task('logger', {type: `info`, message: `the webpage is not scrollable for image: "${imageName}", taking regular screenshot`});
}
} else if (modifiedOptions.scrollMethod === "JS_SCROLL") {
// If the user wants to use the old JS_SCROLL method
cy.task('logger', {type: 'warn', message: `the webpage is not scrollable, not able to lazyload "${imageName}", taking regular screenshot`});
cy.task('logger', {type: 'info', message: `Passed in 'scrollMethod= "JS_SCROLL"' taking regular screenshot`});
} else {
// No errors so far
if ((modifiedOptions.lazyload !== undefined) && (modifiedOptions.lazyload > 10000 || modifiedOptions.lazyload < 0 || isNaN(modifiedOptions.lazyload))){
Expand Down
6 changes: 3 additions & 3 deletions qa/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6837d15

Please sign in to comment.