Skip to content
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

#ss takes screenshot on the step it's attached to #51

Open
vptes1 opened this issue Oct 24, 2019 · 9 comments
Open

#ss takes screenshot on the step it's attached to #51

vptes1 opened this issue Oct 24, 2019 · 9 comments
Labels
enhancement New feature or request

Comments

@vptes1
Copy link
Collaborator

vptes1 commented Oct 24, 2019

Hashtags:

  • #ss takes screenshot on the step it's attached to, after the step is done executing
  • #ss-both takes screenshot before and after its step

Flags:

  • When --screenshots=false, no screenshots are taken
  • When --screenshots=true, screenshots are taken before and after every step
  • When --screenshots=ss, or if --screenshots isn't passed in at all, only steps with #ss/#ss-both have screenshots taken

Step data:

  • This is all independent of --step-data, which describes what kind of data is safe to delete after a test (to prevent overuse of disk space)
@vptes1 vptes1 added the enhancement New feature or request label Oct 24, 2019
@vptes1
Copy link
Collaborator Author

vptes1 commented Oct 24, 2019

Let's discuss this feature request here

@craigvl
Copy link

craigvl commented Oct 24, 2019

Ok I think that this is good, a few comments below:

  • Regarding the --screenshots value I notice that the doco does not tell the user that "True" is the default.

  • Would it be worth having the values:

#ss takes before and after
#ss-before takes before step
#ss-after takes after

Or is this to many options?

Also would it be worth while changing the --step-data flag to something like
--keep-screenshots

I know that the intent here is that there might be other things that are deleted but at the moment it is only screenshots?

This would maybe make the flag more clear / say what it is and give more control in the future if you have other things to delete. Just a thought.

@vptes1
Copy link
Collaborator Author

vptes1 commented Oct 24, 2019

Those are some good points. I like the whole #ss, #ss-before, and #ss-after thing (where #ss means both before and after).

https://smashtest.io/ui-testing/screenshots does say that screenshots are automatically taken (by default). I'll look into how to make this sound more clear, and if I need to add anything to the --screenshots documentation and/or -? output. Suggestions welcome!

I am noticing that the "screenshot everything" approach slows down tests considerably, so much so that the average user probably doesn't want screenshots to be on all the time. That's why I want to make --screenshots=ss the default (if --screenshots is omitted).

As for step-data, it does delete a lot of stuff from the step, like meta-data. That alone can get pretty bulky if there are a large number of steps/branches (each step contains stuff like start/end timestamps, elapsed time, pass/fail state, etc.).

We also want to avoid renaming flags for backwards-compatibility :)

@craigvl
Copy link

craigvl commented Oct 24, 2019

Ok yes I thought that the rename of the step-data would be a breaking change :0)

I agree that #ss should be default

So to summarize the solution would be:

  • add an "ss" option to --screenshots (becomes the default)
  • if --screenshots=ss then will look for tags #ss or #ss-before or #ss-after (what happens if more than one used on same step, just take first?)
  • true and false values behave as they currently do

@vptes1
Copy link
Collaborator Author

vptes1 commented Oct 24, 2019

Yes. And if #ss and #ss-before are listed, it should take it before and after.

@juliensz
Copy link
Collaborator

ok i work on it, i create the solution for #ss-before #ss-after i going to create fail and #ss normal.
I go push new PR tomorrow

@vptes1
Copy link
Collaborator Author

vptes1 commented Oct 26, 2019

(Reposting from other ticket) So there's this pattern that we recommend on the site, particularly in CI/CD environments.
Run smashtest, then run smashtest -s, then run smashtest -s, etc. as many times as you feel you want to repeat failed tests.
Maybe we should just recommend they do smashtest -s --screenshots=true instead? That way they get thorough screenshots, but only for the tests that failed at least once.

@slowmonkey
Copy link

ok i work on it, i create the solution for #ss-before #ss-after i going to create fail and #ss normal.
I go push new PR tomorrow

Hi,

I'm wondering if the #ss feature was implemented and if the PR still exists and if this feature will be available soon?

@craigvl
Copy link

craigvl commented May 19, 2021

No this ticket has not been done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants