简体   繁体   中英

TestCafe / Multiple repository project

I have my TestCafe page models grouped together in different project repositories.

When I try to use these page model repositories/packages in the main project that has the tests, I get various different errors. The latest error I get when I try to run a test that makes use of a page model in a different package is this:

Cannot implicitly resolve the test run in the context of which the test controller action should be executed. Use test function's 't' argument instead.

My page model repository uses babel and has the following in the babelrc file:

{
    "presets": [
        [
            "@babel/preset-env", {
                "targets": {
                    "node": true
                },
                "modules": "commonjs",
                "forceAllTransforms": true,
                "debug": true
            }
        ]
    ]
}

If I don't use babel on the page model repositories, I get issues related to unknown import tokens.

(function (exports, require, module, __filename, __dirname) { import ...
SyntaxError: Unexpected token import

Can someone give me advice on how to get a multiple repository TestCafe project working?

I fear this is not possible, because all test code and all imports must be transpiled by TestCafe before executing tests. Because of this, TestCafe will also ignore any babelrc you might setup. All TestCafe code and all page models should be in the same repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM