1
votes

I want to run a testcafe script inside the SauceLab without using provided plugin.

Say I have a test that can be run on chrome using testcafe on local machine. Now the same test having some browser's capability I want to trigger in SauceLab.

Is it possible or not? if not then why? As Sauce lab provides a grid and browser with capability with help of a remote Saucelab URL can't be run on that grid?

I tried to create a configuration file by mapping the test, defining capability and trigger over SauceLab URL

my test is below that I want to run in SauceLab grid:

fixture `My first fixture`
.page `http://devexpress.github.io/testcafe/example/`;

const page = new page();

test('My first test', async t => {
   await t
    .typeText(page.nameInput, 'P.Parker')
    .click(page.macOSRadioButton)
    .click(page.featureList[0].checkbox)
    .click(page.interfaceSelect)
    .click(page.interfaceSelectOption.withText('Both'))
    .expect(page.nameInput.value).contains('Peter');
});
1

1 Answers

3
votes

There is no such way. These are completely different environments. TestCafe script is executed by Node.js and SauceLabs provides only the browsers. testcafe-browser-provider-saucelabs performs a lot of service things: it sets up a tunnel between your computer and Saucelabs virtual machines, runs specified browsers, passes the test URLs to them and etc.