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

The getCookies action with filter parameters returns the wrong set of cookies in Native Automation mode #7798

Closed
aleks-pro opened this issue Jun 14, 2023 · 1 comment
Assignees
Labels
FREQUENCY: level 2 SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).

Comments

@aleks-pro
Copy link
Collaborator

What is your Scenario?

Use the getCookies action to get coockies with filter parameters

What is the Current behavior?

Cookies are missing in returned cookies set

What is the Expected behavior?

The getCookies action should return all requested cookies

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

https://devexpress.github.io/testcafe/example/

What is your TestCafe test code?

fixture('[API] Get Cookies')
    .page('https://devexpress.github.io/testcafe/example/');

test('Should retrieve a cookie with the specified url', async t => {
    //set a cookie for the Example page
    await t.setCookies({ name: 'apiCookie1', value: 'value1' });

    //set a cookie for localhost
    await t.setCookies({ name: 'apiCookie2', value: 'value2' }, 'http://localhost');

    //retrieve all cookies
    let cookies = await t.getCookies(['apiCookie1', 'apiCookie2']);

    await t.expect(cookies.length).eql(2);

    //retrieve cookies from the Example page
    cookies = await t.getCookies(['apiCookie1', 'apiCookie2'], 'https://devexpress.github.io/testcafe/example/');
    await t.expect(cookies.length).eql(1);

    //retrieve cookies from localhost
    cookies = await t.getCookies(['apiCookie1', 'apiCookie2'], 'https://localhost');
    await t.expect(cookies.length).eql(1);
});

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

You can reproduce the problematic behavior on the following examples:
https://github.com/DevExpress/testcafeio-examples/blob/main/tests/documentation/reference/test-api/test-controller/get-cookies/single-by-url.js
https://github.com/DevExpress/testcafeio-examples/blob/main/tests/documentation/reference/test-api/test-controller/get-cookies/all-by-url.js

TestCafe version

3.0.0-rc.1

Node.js version

No response

Command-line arguments

npx testcafe chrome

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

@aleks-pro aleks-pro added TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: native automation FREQUENCY: level 2 labels Jun 14, 2023
@aleks-pro aleks-pro changed the title The getCookies action with filter parameters returns wrong cookies set in Native Automation mode The getCookies action with filter parameters returns the wrong set of cookies in Native Automation mode Jun 14, 2023
@AlexKamaev AlexKamaev self-assigned this Jun 29, 2023
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Jun 29, 2023
@github-actions
Copy link

Release v3.1.0-rc.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 2 SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants