Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone test controller can be used outside testcafe #4427

Closed
link89 opened this issue Oct 25, 2019 · 2 comments
Closed

Standalone test controller can be used outside testcafe #4427

link89 opened this issue Oct 25, 2019 · 2 comments
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. STATE: Duplicate An issues has been already reported in the other thread.

Comments

@link89
Copy link
Contributor

link89 commented Oct 25, 2019

Testcafe is a battery included automation framework, you can just npm install and start to write script and execute it without any other dependencies. But on the other hand, testcafe's core feature, TestController, can only be used with testcafe, which substantially limits its usage.

As an automation engineer, I hope that testcafe can be integrated with other test framework like jest, as what we can do with webdriver.io.

A possible way to implement this feature is to provide a TestControllerPool to manage the life cycle of test controller. An example to use it with jest (but also with other )would like this

import { createTestControllerPool } from 'testcafe';

// just declare which browser and how many of them to be used
// the number of browser should not less than max browsers used in single cases
const testControllerPool: TestControllerPool = createTestControllerPool(
  {
    browser: 'selenium:chrome',
    number: 4,
  },
);

beforeAll( async () => {
  // browsers will be opened and initialize from here
  await testControllerPool.init();
});

afterAll( async () => {
  // close browsers and release resource from this point
  await testControllerPool.destroy();
});

test('send messages to each other', async () => {
  // withBrowsers is a context manage (like with statement in python), which will checkout
  // 2 controllers from pool before enter the async closure
  // and it will wait automatically if not enough of browser can be used
  // and reset controllers and return to pool after exit the closure
  await testControllerPool.withBrowsers(2, async (t1: TestController, t2: TestController) => {
    // use t1 and t2 to control 2 browsers and do everything you want
  });
})

A lot of features in #3788 can get benefit from this design, like #2835
#912

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 25, 2019
@link89 link89 changed the title Standalone test controller can be used with Standalone test controller can be used outside testcafe Oct 25, 2019
@AndreyBelym AndreyBelym added the STATE: Duplicate An issues has been already reported in the other thread. label Oct 25, 2019
@AndreyBelym
Copy link
Contributor

Thank you for your inquiry. Your idea is great, but we already have a similar suggestion in our repository: #2501. Please use it to be notified about our progress with this feature.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 25, 2019
@lock
Copy link

lock bot commented Nov 4, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Nov 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. STATE: Duplicate An issues has been already reported in the other thread.
Projects
None yet
Development

No branches or pull requests

2 participants