saucelabs / sauce-cypress-plugin

Cypress Plugin to report your results directly to Sauce Labs
MIT License
7 stars 2 forks source link

Attach custom data #76

Open pmerwin opened 1 month ago

pmerwin commented 1 month ago

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

alexplischke commented 1 month ago

I want to add any file found in {x} to be uploaded at end of the test

The reporter does not have that kind of an ability. I'm happy to take it as a feature request though!

webAssetsDir

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!

pmerwin commented 1 month ago

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, { region: 'us-west-1', build: 'cypress-learn-webapp', tags: ['learn-webapp-e2e'], addArtifacts: 'cypress/logs' });

and the plugin will upload all supported file types found in logs (json, txt), in addition to the video, etc

alexplischke commented 1 month ago

@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? To all of them? That'd feel a little excessive and redundant. Just one of them? Feels weird or arbitrary. It'd be a different story if all of the specs were reported as a single Sauce Labs job.