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

Unintended behavior of blobbing in get*Screenshot methods causes screenshots not to be found. #114

Closed
rdyercrx opened this issue Apr 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rdyercrx
Copy link

Y'all are gonna need to rethink the patterning with the getFailed|passed|CustomScreenshots methods

We've got suite scopes demarcated by [suite] in the test name in addition to splitting out by describe blocks. glob tends to cause some major issues with the way you guys do

const pattern = `**/*${testTitle.replace(/[",',:]/g, '')} (failed).png`
glob.sync(pattern);

will return empty for us with our filenames of pattern
[smoke] -- [smoke] (failed).png
, but only when you combine the ${} interp with the globbing in the same operation.
I'd recommend going with a two stage filter.

pattern1 = `**/* (failed).png`
pattern2 = `${testTitle}`
glob.sync(pattern1).filter(it => it.include(pattern2))

Where the glob.sync(pattern1) gets you all the failed, then the filter picks out the one that includes the test name, then hope someone isn't clever and names the describe block the same thing as the it block.
Really not sure why the globbing doesn't like it, and just had to toy with the Node REPL for a while to home in on it, but that's causing us to not get our screenshots into reportportal.

It's an artifact of a test grouping initiative forever ago, so it's not that for us to clear that out of our test repository in it's entirety, but if it comes to that, it just may be what we have to do.

Screen Shot 2022-04-15 at 10 36 53 PM

Lemme know if you need more info.
Screen Shot 2022-04-15 at 10 44 42 PM

@AmsterGet AmsterGet self-assigned this Jun 21, 2022
@AmsterGet
Copy link
Member

Hello @rdyercrx !
The screenshot mechanism has been completely rewritten and released in version 5.1.2.
Have you tried using it?
Please check your issue with the latest agent version.
Looking forward to your feedback!

@AmsterGet
Copy link
Member

I'm going to close this issue.
Feel free to reopen it if your request is still relevant.

@AmsterGet AmsterGet added the bug Something isn't working label Aug 8, 2024
@AmsterGet
Copy link
Member

Related issues:
#73
#78
#68
#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants