DevExpress / testcafe-browser-provider-saucelabs

This is the Sauce Labs browser provider plugin for TestCafe.
https://devexpress.github.io/testcafe/
MIT License
32 stars 41 forks source link

Safari Issues - The environment you requested was unavailable #62

Closed SebastianChece2389 closed 3 years ago

SebastianChece2389 commented 4 years ago

Hello,

we face issues on using safari. We are in parallel in contact with saucelabs, but I also wanted to ask here, because the error message itself is produced by the testcafe-browser-provider-saucelabs plugins (dependency):

We execute fine tests on Chrome, Firefox, Edge on Windows 10. All are working without problems.

But switching to "saucelabs:Safari@latest:macOS 10.14" or "saucelabs:Safari@latest:macOS Catalina" gives us the message: “The environment you requested was unavailable.

I also check saucelabs env by using "testcafe -b saucelabs | grep -i safari" and it is listing me exactly the environments I am using. So all seems fine for me.

After contacting saucelabs support they advice me to switch to another resolution (because "full HD 1920x1080" is not supported on macos/Safari). Here you can find what resolution is supported: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/ I switched to 1600x1200 as it is supported. But still, the same error.

Complete Error messsage Error: [init({"name":"[NAME]","tunnelIdentifier":[TUNNELID],"idleTimeout":1000,"browserName":"safari","version":"latest","platform":"macos catalina","screenResolution":"1600x1200"})] The environment you requested was unavailable.

Of course I checked tons of times if enough slots/licenses are free.

--> Someone has an idea why Safari is not working for us? --> Or any advice how to get a error message about the real problem what is happening? Perhaps you can lead me, where to find the response of saucelabs to check the message-body what saucelabs is answering on requesting the environment.

Thanks a lot! Sebastian

Ogurecher commented 4 years ago

Hello,

Thank you for your patience. We managed to reproduce the issue. As for the error message, the message you shared is actually the response from saucelabs you were looking for.

mciastek commented 3 years ago

Hi @SebastianChece2389, I managed to reproduce your error. It looks like you used wrong platform name. Instead of macos catalina use macOS 10.15. Check it in platform configurator. Here's a similar configuration that maybe you're looking for:

{
  "browserName": "safari",
  "browserVersion": "latest",
  "platformName": "macOS 10.15",
  "sauce:options": {
    "screenResolution": "1600x1200",
  }
}

Oh, I noticed that it's related to this provider not supporting proper configuration options. Why https://github.com/DevExpress/testcafe-browser-provider-saucelabs/pull/63 is not merged yet?

Ogurecher commented 3 years ago

@mciastek, Thank you for noticing this. #63 is not merged because tests for that pull request failed. We'll look into it.

fash-dortadj-cko commented 3 years ago

Hey @SebastianChece2389, did you manage to fix this issue? We're facing the exact problem as you described and none of the solutions I've tried seem to work so far. Other browsers seem to work fine apart Safari.

fash-dortadj-cko commented 3 years ago

I managed to resolve this by specifying a supported resolution in my run script as mentioned in the docs here: like so:

env SAUCE_BUILD=\"Sauce Labs Build - $(date)\" SAUCE_SCREEN_RESOLUTION='1920x1440' SAUCE_API_HOST=eu-central-1.saucelabs.com node configs/saucelabs.configs.js

AND probably more importantly by testing all "available" saucelabs safari browsers and then realising that actually none of the Catalina ones are actually supported even though they're listed.

arubtsov commented 3 years ago

@fash-dortadj-cko Thank you for sharing your workaround.

costag1982 commented 3 years ago

Is this outstanding PR going to fix this issue?

https://github.com/DevExpress/testcafe-browser-provider-saucelabs/pull/63

I really need to test on Catalina but it doesnt work for me also

costag1982 commented 3 years ago

I have tried running these:

SAUCE_API_HOST=eu-central-1.saucelabs.com SAUCE_USERNAME=IWConsulting SAUCE_SCREEN_RESOLUTION=1920x1440 BROWSERS='saucelabs:Safari@latest:macOS Catalina' nodeindex.mjs`

I get this back:

Error: [init({"tunnelIdentifier":1605088752819,"idleTimeout":1000,"browserName":"safari","version":"latest","platform":"macos catalina","screenResolution":"1920x1440"})] The environment you requested was unavailable.

I have also tried:

SAUCE_API_HOST=eu-central-1.saucelabs.com SAUCE_USERNAME=IWConsulting SAUCE_SCREEN_RESOLUTION=1920x1440 BROWSERS='saucelabs:Safari@latest:macOS 10.15' node index.mjs

and i get back this error:

Error: Unable to find the browser. "saucelabs:Safari@latest:macOS 10.15" is not a browser alias or path to an executable file.

wentwrong commented 3 years ago

@costag1982, Yes, #63 is supposed to fix this problem, but it does not yet. I reproduced the error and tried to run tests on macOS 10.15 with different settings (browsers, screen resolutions, etc) as suggested above, but I wasn't able to resolve it - the same "The environment you requested was unavailable" error is thrown. We need more time to debug this issue.

costag1982 commented 3 years ago

@wentwrong thanks, with Mac OS Big Sur available on saucelabs will resolving this issue also enable us to use latest Safari and OS that is supported in saucelabs?

Thanks

wentwrong commented 3 years ago

@costag1982, no, the fix (#63) will not resolve the issue with macOS 11.00. It's presented in SauceLabs Platform Configurator, but the list of available browsers that TestCafe shows (by running 'testcafe -b saucelabs') doesn't include it currently. We need to look at it separately. I created an issue to track this: Support macOS Big Sur.

danderbury commented 3 years ago

Hi has anyone been able to run tests with catalina or BigSur?

AndreyBelym commented 3 years ago

You can just omit the OS version part. In this case, Saucelabs will start the latest OS version automatically (right now it is Big Sur):

testcafe "saucelabs:safari" test.js