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

Not able to uninstall Cypress 13.8.1 #29478

Closed
pujantrivedicisco opened this issue May 6, 2024 · 5 comments
Closed

Not able to uninstall Cypress 13.8.1 #29478

pujantrivedicisco opened this issue May 6, 2024 · 5 comments

Comments

@pujantrivedicisco
Copy link

Current behavior

I want to completely uninstall Cypress 13.8.1, then reinstall it. i tried commands npm uninstall cypress --force
, then npm uninstall cypress --legacy-peer-deps
etc.
but still able to launch cypress using npx or pnpx cypress open

i want to completely uninstall so that i can install it again.

Reason i want to install it again is, in myscript i want to capture / intercept the API call, so as to get the jwt token after login, currently, m not able to extract it using below code
cy.intercept('GET', uri).as('whoamiRequest');
cy.visit('/'); //This will reload page, which will load the API get call, which has token in its header
cy.wait('@whoamiRequest').then((interception) => {
let authorizationHeaderValue = interception.request.headers['Authorization:'];

  return cy.wrap(authorizationHeaderValue).as('authToken');
});

but this gives blank value for token, though there is a token stored in Authorization header, so to troubleshoot i want to completely uninstall and install cypress latest version, then try again.

Desired behavior

No response

Test code to reproduce

cy.intercept('GET', uri).as('whoamiRequest');
cy.visit('/'); //This will reload page, which will load the API get call, which has token in its header
cy.wait('@whoamiRequest').then((interception) => {
let authorizationHeaderValue = interception.request.headers['Authorization:'];

  return cy.wrap(authorizationHeaderValue).as('authToken');
});

Cypress Version

13.8.1

Node version

v20.5.1

Operating System

macOS

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

@pujantrivedicisco Do you remember how you first installed Cypress? There’s a few different ways you could have. https://docs.cypress.io/guides/getting-started/installing-cypress#Installing

@pujantrivedicisco
Copy link
Author

@jennifer-shehane , i first installed version 12.17.4, then after few weeks, installed 13.8.1 using npm install cypress --save-dev, then pnpm install to install dependencies

@pujantrivedicisco
Copy link
Author

I tried direct app installed too, downloaded it, put it in applications folder, then configured my project with it.

I am facing total two issues

  1. The API call is not getting intercepted, the variable is not getting the jwt token in response in below code.

    cy.intercept('GET', uri).as('requestalias');
    cy.wait(2000)
    cy.visit('/');
    cy.wait('@requestalias').then((interception) => {
    let authorizationHeaderValue = interception.request.headers['Authorization:'];

    if (!authorizationHeaderValue) {
    authorizationHeaderValue = interception.response.headers['Authorization'];
    }

    cy.log("The value of the Authorization header is:", authorizationHeaderValue);
    return cy.wrap(authorizationHeaderValue).as('authToken'); //this authtoken is blank for me

to troubleshoot above, i thought to clean install cypress all over again and try, but now cypress is not at all completely uninstalling.

@MikeMcC399
Copy link
Contributor

@pujantrivedicisco

You may like to connect to the Cypress technical community on Discord

Discord chat (click on button)

where other users help each other and provide support.

@jennifer-shehane
Copy link
Member

Closing as there isn't an indication of a bug within Cypress to address here.

@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants