-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postponed image saved in workspace (mobile) #2
Comments
Hi @tuan91 thanks for filling an issue, can you please share the complete code? Secondly,are you using both commands? browser.saveElement(element, imageNameMobile, {});
browser.checkElement(element, imageNameMobile, {}); Because the is not needed. |
Hi @wswebcreation if (mtFunctions.isDesktop()) {
ProductDetailPage.open("10171918");
ProductDetailPage.getAvaibleProduct(ProductDetailPage.availableVarianteSizeSelect).click();
browser.pause(2000);
ProductDetailPage.saveSpecifiedElementLayout(ProductDetailPage.infoBoxLayout, "infobox sizelist selected",
ProductDetailPage.infoBoxLayout, "infobox sizelist selected");
ProductDetailPage.checksaveSpecifiedElementLayout(0, ProductDetailPage.infoBoxLayout, "infobox sizelist selected",
ProductDetailPage.infoBoxLayout, "infobox sizelist selected");
}
getAvaibleProduct(selector) {
if (selector.length > 0) {
return selector[0];
}
throw new Error("Kein verfügbares Produkt gefunden!");
}
saveSpecifiedElementLayout(elementMobile, imageNameMobile, element, imageName) {
if (mtFunctions.isSmartPhone()) {
elementMobile.scrollIntoView();
browser.pause(2000);
browser.saveElement(elementMobile, imageNameMobile, {});
} else {
browser.onload = () => {
element.waitForDisplayed();
element.scrollIntoView();
browser.pause(2000);
browser.saveElement(element, imageName, {});
};
}
}
checksaveSpecifiedElementLayout(comparisonNumber, elementMobile, imageNameMobile, element, imageName) {
if (mtFunctions.isSmartPhone()) {
browser.pause(3000);
const perCheckMobile = browser.checkElement(elementMobile, imageNameMobile, {});
if (perCheckMobile > comparisonNumber) {
throw new Error("expect to be less than " + comparisonNumber + "%! Recent differences:" + perCheckMobile +"%");
}
} else {
browser.onload = () =>{
browser.pause(3000);
const perCheck = browser.checkElement(element, imageName, {});
if (perCheck > comparisonNumber) {
throw new Error("expect to be less than " + comparisonNumber + "%! Recent differences:" + perCheck + "%");
}
};
}
} I use both methods. Updated with proper markdown |
Hi @tuan91 Thanks for the feedback, I need to dive into the issue, but I'm kinda packed today and tomorrow. I hope to have time for it this week.
You only use The |
Hi @wswebcreation I'll wait for your feedback! |
Hi @tuan91 I've been checking this on the Sauce Labs real device cloud (I don't have an account for Browserstack), but all seems to work how it should work. This is the script I'm using describe('wdio-test', () => {
it('issue 2', () => {
browser.url('https://www.mytoys.de/birkmann-kekskunst-zum-selbermachen-4283014.html');
const box = $('.prod-info__box-container.js-prod-info-box');
box.scrollIntoView();
browser.checkElement(box, 'box-example');
})
}) And it gives this output Which is what I expect it to be. I think the problem in this case is that the element-id is already determined before the scroll really has been executed. This means that when it needs to determine the position (x,y,width, height) of the element, it is not in it's endposition. Going to close it for now because it looks like it works as designed. It's still open for discussion . |
Hi @wswebcreation Can you insert the code in front of your code and run it again?
|
Hi @tuan91 Again, it works for me describe('wdio-test', () => {
it('issue 1', () => {
browser.url('https://www.mytoys.de/birkmann-kekskunst-zum-selbermachen-4283014.html');
const box = $('.prod-info__box-container.js-prod-info-box');
box.scrollIntoView();
browser.checkElement(box, 'box-example-1');
})
it('issue 2', () => {
browser.url('https://www.mytoys.de/birkmann-kekskunst-zum-selbermachen-4283014.html');
const box = $('.prod-info__box-container.js-prod-info-box');
box.scrollIntoView();
browser.checkElement(box, 'box-example-2');
})
}) |
hi @wswebcreation |
Looks like the link doesn't work |
Oh sorry it was "private". |
Hi @wswebcreation |
Hi @tuan91 I found the problem. It's partially a problem of this module and partially a problem in you capabilities. This module checks the platform (iOS/Android) based on the |
I've release version https://github.com/wswebcreation/wdio-image-comparison-service/releases/tag/v1.5.0 |
Hi @wswebcreation i can't update the latest version. Generally I can't install the module anymore. Error Massage:
npm ERR! code ELIFECYCLE npm ERR! A complete log of this run can be found in: Should I create a bug ticket or is this info enough for you? |
Hi @tuan91 Can you recheck again, a new version of |
Closing this one due to inactivity |
WebdriverIO version: 5.7.15
Mode: WDIO Testrunner
If WDIO Testrunner, running sync/async: sync
Node.js version: 10.15.1
NPM version: 6.4.1
Platform name and version: Browserstack
Additional wdio packages used (if applicable): "@wdio/browserstack-service": "^5.7.13", "wdio-image-comparison-service": "^1.1.0"
wdio.conf
Describe the bug
Visual Regression Test:
expectation:
I want to scroll to an element and save the layout of the element as an image.
Problem only on Mobile:
The image is stored incorrectly. Browserstack indicates that the image was properly saved, but a postponed image is saved in the workspace.
Problem only occurs when several ITs running. If only one IT is running then it will work.
Element:".prod-info__box-container.js-prod-info-box"
URL: https://www.mytoys.de/birkmann-kekskunst-zum-selbermachen-4283014.html
Image Workspace
Image Browserstack
approach:
-browser.pause(3000), before save Picture
-Instead of searching at the search bar, we went directly to the specific URL.
To Reproduce
element.scrollIntoView();
browser.saveElement(element, imageNameMobile, {});
browser.checkElement(element, imageNameMobile, {});
The text was updated successfully, but these errors were encountered: