Run Test in Test Cafe Studio nightly

I have a test created in Test Cafe Studios. I would like to have that test run automatically each night without needing a user to run the test (open the program, click start, etc) Is such a thing possible with this software? It would be helpful if there were some example of how to solve this! I have pasted some of the code for a very basic test, just checking if the pages will open. I have filled-in some of the '' with generic information for the question

Thanks in advance.

Windows Task Scheduler

import { Selector } from 'testcafe';

fixture `svdemo`
.page `my website here `
.httpAuth({
    username: 'username',
    password: 'password',
    domain: 'domain'
});

test('Visit Each Page', async t => {
await t
    .click(Selector('span').withText('Page1'))
    .click(Selector('a').withText('Homepage'))
    .click(Selector('a').withText('Page2'))
    .click(Selector('a').withText('Homepage'))
    .click(Selector('a').withText('Page3'));

});

I expect to see the test run and pass each night on its own.

Upvotes: 2

Views: 346

Answers (1)

Dmitry Ostashev
Dmitry Ostashev

Reputation: 2348

You need to use any Continuous Integration system for this purpose. The CI system supports automatic test execution instead of running tests manually using the UI. Take a look at the topic about how to use TestCafe with modern Continuous Integration systems.   As another way, you can try to use Windows Task Scheduler as it is described here What is the best way to run Node script continuously on Windows (for example, automatically run it daily)?

Upvotes: 10

Related Questions