|
2 | 2 |
|
3 | 3 | describe("Frontend test for Login and Sending Message", () => {
|
4 | 4 | it("Logs in and is able to fill the webform", () => {
|
5 |
| - cy.visit("https://frontend.lndo.site/auth/login?callbackUrl=%2Fen%2F"); |
6 |
| - cy.get("input#username").type("testuser1"); |
7 |
| - cy.get("input#password").type("test").type("{enter}"); |
| 5 | + cy.visit("https://frontend.lndo.site/auth/login?callbackUrl=%2F"); |
| 6 | + cy.get('input[name="username"]').type("testuser1"); |
| 7 | + cy.get('input[name="password"]').type("test").type("{enter}"); |
8 | 8 | cy.wait(3000);
|
9 |
| - cy.get("input#name").type("Mario"); |
10 |
| - cy.get("input#email").type("[email protected]"); |
11 |
| - cy.get("textarea#message").type("hello hello!"); |
12 |
| - cy.get("input#subject").type("cypress testing 101").type("{enter}"); |
| 9 | + cy.get('input[name="name"]').type("Mario"); |
| 10 | + cy.get('input[name="email"]').type("[email protected]"); |
| 11 | + cy.get('textarea[name="message"]').type("hello from Cypress!"); |
| 12 | + cy.get('input[name="subject"]').type("cypress testing 101").type("{enter}"); |
13 | 13 | cy.wait(1000);
|
14 | 14 | });
|
15 | 15 | });
|
16 | 16 |
|
17 |
| -// describe("Frontend Test for Search Functionality", () => { |
18 |
| -// it("Opens the page, performs search, and verifies search results", () => { |
19 |
| -// // Navigating to the main page and clicking on Search button |
20 |
| -// cy.visit("https://frontend.lndo.site"); |
21 |
| -// cy.get('a[href="/search"]').click(); |
22 |
| -// cy.wait(500); |
23 |
| -// // Searching for string "Drupal" |
24 |
| -// cy.get("[data-transaction-name='search input']").type("Drupal"); |
25 |
| -// cy.get("[data-transaction-name='search submit']").click(); |
26 |
| -// // Waiting for the search results to load |
27 |
| -// cy.wait(1000); |
28 |
| -// // Verifying results |
29 |
| -// cy.get(".sui-results-container").should("be.visible"); |
30 |
| -// cy.contains("Drupal and Next.js can be used together").should("be.visible"); |
31 |
| -// }); |
32 |
| -// }); |
| 17 | +describe("Frontend Test for Search Functionality", () => { |
| 18 | + it("Opens the page, performs search, and verifies search results", () => { |
| 19 | + // Navigating to the main page and clicking on Search button |
| 20 | + cy.visit("https://frontend.lndo.site/search"); |
| 21 | + cy.wait(1000); |
| 22 | + // Searching for an article: |
| 23 | + cy.get("input[type=search]").type("Example article"); |
| 24 | + // Waiting for the search results to load |
| 25 | + cy.wait(1000); |
| 26 | + // Verifying results |
| 27 | + cy.get(".ais-Hits-item").should("be.visible"); |
| 28 | + cy.contains("Example Article: A Step-by-Step Guide to [Topic]").should( |
| 29 | + "be.visible", |
| 30 | + ); |
| 31 | + }); |
| 32 | +}); |
33 | 33 |
|
34 | 34 | describe("Frontend Test for Language Switching", () => {
|
35 | 35 | it("Opens the page, switches language and verifies it", () => {
|
36 | 36 | // Navigating to the main page and clicking on Language button
|
37 | 37 | cy.visit("https://frontend.lndo.site");
|
38 |
| - cy.contains("English").click({ force: true }); |
| 38 | + cy.get('[data-language-name="English"]').click({ force: true }); |
39 | 39 | cy.wait(500);
|
40 | 40 | // Clicking through the language options and checking translations
|
41 | 41 | cy.contains("Suomi").click({ force: true });
|
|
0 commit comments