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 New cypress Test for language selection and link redirection #9017

Closed
nihal467 opened this issue Nov 6, 2024 · 14 comments
Closed

Add New cypress Test for language selection and link redirection #9017

nihal467 opened this issue Nov 6, 2024 · 14 comments
Assignees

Comments

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2024

Description

Add a new Cypress test to verify language selection and repository redirection functionality.

Conditions to follow

  • Add these tests to the redirect.cy.ts file.
  • Use the Page Object Model (POM) approach.
  • Reuse existing functions and add necessary API verification with cy.intercept.

Test - 1

  • After the LoginPage loads, click the "Contribute on GitHub" link and verify redirection by checking the URL and the new page content.
  • Repeat the same for the "Third Party Software License" link.

Test - 2

  • After the login page loads, switch between all five languages and verify that the login submit button text updates according to the selected language.
  • Log in with any language selected other than English and verify that the sidebar items display in the chosen language

Screenshot

Image

@nihal467 nihal467 changed the title Add New cypress Test for language selection and org repo redirection Add New cypress Test for language selection and link redirection Nov 6, 2024
@nihal467 nihal467 added this to Care Nov 6, 2024
@github-project-automation github-project-automation bot moved this to Triage in Care Nov 6, 2024
@AdityaJ2305
Copy link
Contributor

@nihal467 I would like to work on this issue. Could you assign it to me ?

@Kaushikgtm
Copy link

@nihal467 can you assign this to me ?

@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 17, 2024
@AdityaJ2305
Copy link
Contributor

@nihal467 Apologies, but I’m not working on this issue. Please assign it to @Kaushikgtm. Thanks!

@nihal467 nihal467 assigned Kaushikgtm and unassigned AdityaJ2305 Nov 18, 2024
@Kaushikgtm
Copy link

@nihal467 I have write code for Cypress test -1 but face some difficulty to write cypress test-2 should i raise a PR for test-1 or not ?

@nihal467
Copy link
Member Author

@Kaushikgtm what is the difficulty you are facing, share the issue

@Kaushikgtm
Copy link

Kaushikgtm commented Nov 19, 2024

Hii @nihal467 The LANGUAGES and resources are managed via i18next, but I cannot figure out how to reference them correctly in the Cypress tests. Translations like sidebar items and button text are already implemented in i18n and LanguageSelector components. However, I’m unsure how to fetch and use these dynamically in the test cases to verify language-specific UI updates.
Image

@Kaushikgtm
Copy link

@nihal467 there is no function in Page Object Model which Verify Language for Login and Sidebar items, can you help ?

@Kaushikgtm
Copy link

Kaushikgtm commented Nov 20, 2024

can i raise a PR for test-1?
Image

@nihal467
Copy link
Member Author

@Kaushikgtm

  • In the Test 1 code you wrote, you are not interacting with the platform at all. You are only interacting with the browser and verifying its URL. That's not what the test is about. Please read the issue carefully and write the test accordingly.

  • In Test 2, if there is no page object already present, you need to create a new ID and page object to write the test.

@Kaushikgtm
Copy link

Kaushikgtm commented Nov 20, 2024

@nihal467 updated test 1 code
Image
loginpage in POM updated
Image

@nihal467
Copy link
Member Author

@Kaushikgtm raise the PR for review purpose

@nihal467 nihal467 removed question Further information is requested needs-triage labels Nov 25, 2024
@Kaushikgtm
Copy link

Hii @nihal467 I’m working on Test 2 to verify that the sidebar items display correctly in the selected language after switching between the five supported languages. The sidebar content is already defined in six different language files within the repository.
Should I Duplicate the sidebar mapping in the loginpage mapping file for test verification, or Reuse the existing language files directly?

@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 26, 2024
@nihal467 nihal467 removed question Further information is requested needs-triage labels Nov 29, 2024
@nihal467
Copy link
Member Author

@Kaushikgtm dont use the existing language typo variable, declare constant's and verify using that

@rajku-dev
Copy link
Contributor

Hi @Jacobjeevan , can i work on this issue?

@github-actions github-actions bot added needs-triage question Further information is requested labels Dec 28, 2024
@Jacobjeevan Jacobjeevan removed question Further information is requested needs-triage labels Dec 28, 2024
@rithviknishad rithviknishad closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Care Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment