镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Regression in 2.3.0 #7482

Closed
Closed

Description

@michael-mader

What is your Scenario?

A regression was introduced in testcafe 2.3.0 which causes the following code to throw an error.

It used to run in older versions of testcafe and does not look faulty.

What is the Current behavior?

Running the test fails with this message:

~/tmp/testcafe-bug »  npx testcafe chrome:headless
ERROR Cannot prepare tests due to the following error:

TypeError: _index.test.meta is not a function
    at Object.<anonymous> (/Users/user/tmp/testcafe-bug/tests/test.js:14:6)

Type "testcafe -h" for help.

What is the Expected behavior?

the test runs without issues

What is your public website URL? (or attach your complete example)

What is your TestCafe test code?

// this is working:
//import { Selector } from 'testcafe';
// this works also:
//import { Selector, fixture } from 'testcafe';
// this causes the described error message:
import { Selector, fixture, test } from 'testcafe';

const nameInput = Selector('#developer-name');

fixture `A set of examples that illustrate how to use TestCafe API`
    .page `https://devexpress.github.io/testcafe/example/`;

// Tests
test.meta('dev', 'true')('Text typing basics', async t => {
    await t
        .typeText(nameInput, 'Peter') // Type name
        .typeText(nameInput, 'Paker', { replace: true }) // Replace with last name
        .typeText(nameInput, 'r', { caretPos: 2 }) // Correct last name
        .expect(nameInput.value).eql('Parker'); // Check result
});

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. create the testfile with the code above
  2. run it either with npx testcafe chrome or whatever
  3. see it fail

if you change to another kind of import in the first few lines it is working. It stops working as soon as test is imported from testcafe package (which makes typehints in your editor possible, that's why we have this somewhat redundant import)

TestCafe version

2.3.0

Node.js version

No response

Command-line arguments

irrelevant

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

Activity

  1. added
    TYPE: bugThe described behavior is considered as wrong (bug).
    on Feb 1, 2023
  2. self-assigned this
    on Feb 2, 2023
  3. Aleksey28 commented on Feb 2, 2023

    @Aleksey28
    Collaborator

    Hi @michael-mader,

    I reproduced the issue. As a workaround, you can put meta after the test function:

    test('Text typing basics', async t => {
        await t
            .typeText(nameInput, 'Peter') // Type name
            .typeText(nameInput, 'Paker', { replace: true }) // Replace with last name
            .typeText(nameInput, 'r', { caretPos: 2 }) // Correct last name
            .expect(nameInput.value).eql('Parker'); // Check result
    }).meta('dev', 'true');

    We will update this thread once we have news.

  4. michael-mader commented on Feb 2, 2023

    @michael-mader
    Author

    yes that works. I've tested it before but it is really tedious to change this for 200+ tests 😞
    For now I stick with the old version of testcafe until this is fixed

  5. removed
    STATE: Need responseAn issue that requires a response or attention from the team.
    on Feb 3, 2023
  6. added a commit that references this issue on Feb 3, 2023
    f426301
  7. github-actions commented on Feb 6, 2023

    @github-actions

    Release v2.3.1-rc.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TYPE: bugThe described behavior is considered as wrong (bug).

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions