Paduchuri Dinesh
Paduchuri Dinesh

Reputation: 29

How to run the generated remoteconnection url directly in other machines browser Testcafe

This is the code

const createTestCafe = require('testcafe');

let testcafe = null;
let connection = null;

const angulartests = [
    'tests/Selector.test.ts'
]



const concurrency = 2;

var processFailed = false;
createTestCafe('localhost', 1337, 1338)
    .then(async tc => {
        testcafe = tc;

        return  testcafe.createBrowserConnection();
    })
    .then(async bc => {
        connection = bc;
        console.log(connection.url);
        const runner = testcafe.createRunner();
        const angulartestfailedcount = await runner
            .src(angulartests)
           // .browsers(['chrome'])
            .browsers(connection)
            //.{speed : (0.1) }
            .screenshots('C:/dbm',true,'${DATE}_${TIME}/${FIXTURE}/${TEST}_${TEST_INDEX}.png')
           // .concurrency(concurrency)
            .reporter('xunit', 'C:/dbm/Labsession.xml').run();

                return angulartestfailedcount;
    })

    .then(failedCount => {
        console.log('Tests failed: ' + failedCount);
        testcafe.close();
        if (!failedCount)
            process.exit(0);
        process.exit(-1)
    });

Result: This is the URL generated: http://localhost:1337/browser/connect/yX3Zt2j Currently, to run in another machine's browser, we need to manually connect to that machine and run on the browser.

But Remote execution is something automatically runs on other Desktop.

In this case how to run the generated URL on other desktops without manual interruption.

Upvotes: 1

Views: 183

Answers (1)

mlosev
mlosev

Reputation: 5227

At present, TestCafe doesn't have a such functionality. There is a suggestion for similar feature in the TestCafe repository on Github. Track it to be informed about progress.

Upvotes: 1

Related Questions