-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
screenshotsFolder not working correctly #1525
Comments
So, this is definitely what you are experiencing. However, I believe this is because not all of the configuration options are mutable at runtime with But also, this is incredibly confusing if this is the case because:
Either way, I think you should be able to change the |
Girl, I'm more confused now! I have nothing in What I want to do is specify screenshot folder on the viewport, if mobile save to the mobile folder etc. I don't understand what you want to say with this other post you linked, it seems fixed. Using I want to note that Entering the Test code in my previous comment is what I use to run my test. Clicking on assert and screenshot after test is finished returns this in console :
As can you see it save to wrong folder. |
Sorry, yes, I should have been clearer. I believe that Cypress needs to do work on our end to make this work and that Cypress should do work to support this feature. I do not think there is a workaround for you to achieve what you're trying to do today. |
Although we provide to you We probably could make it mutable - and better yet, we should automatically throw if you try to set configuration values which are ignored from inside of the tests, so at least it's clear. I believe there's another issue open somewhere about this. I think to solve your problem we will automatically nest screenshots within the |
We have been having some discussion recently on allowing passing a directory to the screenshots command. See #1771 This would clean up the code in your original issue to the following: let lang_array = ['et_EE', 'en_US', 'ru_RU']
it('Homepage test', function () {
cy.wrap(lang_array).each(function (lang, i) {
cy.viewport(1680, 1050)
cy.visit(`/?lang=${lang}`)
cy.screenshot(`desktop/homepage_desktop_${lang}`)
cy.viewport(720, 1280)
cy.screenshot(`medium/homepage_medium_${lang}`)
cy.viewport(320, 480)
Cypress.config('userAgent', 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25')
cy.screenshot(`mobile/1 homepage_mobile_${lang}`)
})
}) |
Current behavior:
Using
screenshotsFolder
does not save fails to correct folder when usingcy.screenshot
Expected passes the test, but screenshots are saved to wrong folder
cypress/screenshots
.Desired behavior:
Using
screenshotsFolder
on a test should save fails correct folderHow to reproduce:
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
The text was updated successfully, but these errors were encountered: