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

Add e2e tests #58

Open
chrstnbwnkl opened this issue Feb 7, 2023 · 7 comments
Open

Add e2e tests #58

chrstnbwnkl opened this issue Feb 7, 2023 · 7 comments

Comments

@chrstnbwnkl
Copy link
Member

Right now, we're not testing. We could add some basic e2e tests with e.g. cypress.

@chrstnbwnkl chrstnbwnkl added the good first issue Good for newcomers label Feb 7, 2023
@aa98-45556443355666
Copy link

I want to work on this issue for GSOC 2023. Kindly assign to me.

@nilsnolde
Copy link
Member

The application period opens in 4 weeks, we don't even know yet if this is going to happen or not.

It's always good to get a head start though, but may I suggest a smaller issue (this is fairly big and should be tackled during GSoC), e.g. #50. That has a huge impact on UX but is not much work.

@YashGupta018
Copy link

Good Afternoon Sir,
I would like to work on in issue as GSoc'23
This is my first time as an open source contributor
I did manage to add e2e, though I'm not sure it is completely functional or not, Sir Please check and reply back :)
And Sorry I did something wrong!

  1. Install Cypress
    npm install cypress --save-dev

  2. Create a new Cypress test file in the "cypress/integration" directory, for example "example_spec.js"

  3. Open the Cypress Test Runner by running
    npx cypress open

4)In the Test Runner, click on the "example_spec.js" file to run the tests.

  1. Write your e2e tests in the "example_spec.js" file using the Cypress API. For example
describe('My First Test', () => {
  it('Visits the homepage', () => {
    cy.visit('https://example.com')
  })
  it('Searches for "Cypress"', () => {
    cy.get('input[name="q"]').type('Cypress')
    cy.get('button[type="submit"]').click()
    cy.url().should('include', 'search?q=Cypress')
    cy.get('h3').should('contain', 'Cypress')
  })
})

This test visits the homepage of "example.com" and searches for the term "Cypress" using the search input field and submit button. Then it asserts that the resulting page URL contains the search term and that the page contains a heading with the term "Cypress".

  1. Save the "example_spec.js" file and run the tests in the Cypress Test Runner.

We can use the Cypress API to write more complex e2e tests for your application.

Sir is my approach correct, please reply back

@nilsnolde nilsnolde removed the good first issue Good for newcomers label Feb 27, 2023
@nilsnolde
Copy link
Member

Sorry, this was accidentally labeled as "good first issue". But you should have read previous comments, which clearly say (this is fairly big and should be tackled during GSoC), so I don't feel too bad;)

@Ghat0tkach
Copy link
Contributor

@nilsnolde as you said its a fairly big issue , may i start with implementing basic tests like visiting the website? As im complete novice in cypress , i'll try to learn bout it and do contribution while learning?

@nilsnolde
Copy link
Member

that'd be very nice @Ghat0tkach thanks!

@Ghat0tkach
Copy link
Contributor

@nilsnolde , when i was installing using npm , i found a lot of libraries which have been depreciated
image
shall i raise issue for them or is it okay?

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

5 participants