-
Notifications
You must be signed in to change notification settings - Fork 2
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
Attach custom data #76
Comments
The reporter does not have that kind of an ability. I'm happy to take it as a feature request though!
I'll remove this from our options interface. This field has a very specific use case on our Sauce Labs VMs and is configured by our test runners. It's not meant to configured by end users. Sorry for the confusion this may have caused! |
Awesome, I am trying to add some axe json reports I have landed in cypress/logs: would be cool if could do something like: config = sauceLabsPlugin(on, config, { and the plugin will upload all supported file types found in logs (json, txt), in addition to the video, etc |
@pmerwin I have usability question. The plugin currently creates a report (i.e. one Sauce Labs job) per spec file. For the kind of feature you're requesting, where exactly would you expect those artifacts to be uploaded to? |
I was thinking we could have a supported file types like .log,. txt, .json, and anything found of those types in the 'artifact dir' will be uploaded. config = sauceLabsPlugin(on, config, { Uploaded to the sauce job where the video is sent and available there via dropdown for logs. https://share.zight.com/mXuQ5Nn0
|
Something like this:
|
I got this working locally :) https://app.saucelabs.com/tests/9181172207dc43ffa730c2b506a5b2f0 |
Thanks for the demo! 📺 We do have a usability concern though 🤔 I'll try my best explaining it! 🤞 The plugin creates a report per spec file. In your example/PR, a selection of files from the artifact folder are uploaded as a test result to Sauce. What happens when it's the next spec's turn to have a report created? Those files will be uploaded yet again. And again for the next one and so on. Should we skip the files we've already encountered between specs? I'd love to find out more about your use case. Perhaps we can still design something that satisfies your needs!
What creates those files—or where from? If it's spec specific, we could potentially follow a specific pattern to be able to associate those files back to the spec. Let's say you are creating logs from within your spec files and writing them to |
I have it working here, we cleanse the dir after each spec run if it exists. |
That could indeed work! I shall bring it up with the team 🎉 |
@pmerwin Alright! I'm back with two proposals that I'd love to hear your thoughts on (and anyone else following this thread). Mind you, they're not mutually exclusive. Proposal 1: Task for File AttachmentsThe idea here is to introduce a new task that you call from within your spec files, allowing you to explicitly "attach" files. The input could be a filepath or a stream along with the desired filename. The attached file will be uploaded to the job that matches the specified spec file. Disclaimer: The task name in the screenshot merely serves to illustrate the example. Naming TBD. Proposal 2: Folder UploadsSimilar to how Cypress itself stores videos and screenshots in user specified folders that underneath are spec specific (e.g. Upload all files from a user specified folder |
Awesome, we are currently using the fork I made, but I would be willing to test your strategy and adopt it instead. |
@pmerwin Any personal preference from you and your team with regards to which of these two approaches (proposal 1 vs 2)? Either works? |
Why not allow both? :) |
Expected Behavior
I want to add any file found in cypress/logs to be uploaded at end of the test
Actual Behavior
@saucelabs/cypress-plugin
config = sauceLabsPlugin(on, config, {
region: 'us-west-1',
build: 'cypress-learn-webapp',
tags: ['learn-webapp-e2e'],
webAssetsDir: 'cypress/logs'
});
this breaks and videos are not uploaded ^
Steps to Reproduce the Problem
Try and send custom data with the plugin
Specifications
The text was updated successfully, but these errors were encountered: