Skip to main content

Featured Post

AIforce Is Now SIforce: What Salesforce Renamed and What It Means

SIforce is the new name for AIforce , Salesforce's agentic integration layer. CEO Marc Benioff announced the rename on X on October 9, 2026, writing: "The era of Super Intelligence is here. AIForce is officially SIForce." If you searched for "what products were renamed from AIforce to SIforce", the short answer is one : AIforce itself. This guide explains what changed, what did not, and what it means for admins and developers. Quick Answer: What Was Renamed? Earlier name Current name Date Headless 360 (became AIforce) April 2026 – September 2026 AIforce (became SIforce) September 15, 2026 – October 9, 2026 SIforce Current name October 9, 2026 – present That makes SIforce the third name for the same feature in just over six months. As of the coverage we reviewed, no other Salesforce product was reported as renamed from "AI" to "SI". Agentforce, Einstein and the other Salesforce products were not mentioned in the rename reports. W...

End-to-end Testing Login and Signup Pages with Cypress

When building web applications, it’s essential to ensure the login and signup pages work smoothly. One of the most efficient ways to achieve this is through automated testing using Cypress. Cypress makes it simple to write tests that check user interactions, ensuring everything behaves as expected.

In this post, we'll walk through how to test login and signup pages using Cypress. We'll focus on three core functionalities:

  • Login Process: Verifying that a user can log in with correct credentials.

  • Signup Process: Ensuring that a new user can sign up successfully.

  • Post-login Verification: Confirming that the user is redirected to the correct success page.

Setting Up Cypress

Before writing the tests, ensure you have Cypress set up in your project. If you haven’t already installed Cypress, run:

npm install cypress --save-dev

Once installed, open Cypress for the first time:

npx cypress open

This will launch the Cypress Test Runner and open the Cypress UI, where you can run your tests.

Writing Login Tests

First, let’s create tests to ensure users can log in properly.

Test Case 1: Successful Login

  • Visit the Login Page

  • Fill in the login form with valid credentials

  • Click the Submit button

  • Verify that the user is redirected to the success page

  • Confirm the page displays "Congratulations student. You successfully logged in!"

Cypress Test Code:

describe('Login Page Tests', () => {
  it('should log in with valid credentials', () => {
    cy.visit('https://practicetestautomation.com/practice-test-login/');
    
    cy.get('#username').type('student');
    cy.get('#password').type('Password123');
    cy.get('#submit').click();
    
    cy.url().should('include', '/logged-in-successfully');
    cy.contains('Congratulations student. You successfully logged in!').should('be.visible');
  });

  it('should display an error for invalid credentials', () => {
    cy.visit('https://practicetestautomation.com/practice-test-login/');
    
    cy.get('#username').type('wronguser');
    cy.get('#password').type('wrongpassword');
    cy.get('#submit').click();
    
    cy.contains('Your username is invalid!').should('be.visible');
  });
});

Writing Signup Tests

Next, let’s test the signup page to ensure that new users can sign up.

Test Case 2: Successful Signup

  • Visit the Signup Page

  • Fill in the form with valid information

  • Click the Submit button

  • Verify the user is redirected to the login page

Cypress Test Code:

describe('Signup Page Tests', () => {
  it('should sign up a new user', () => {
    cy.visit('/signup');
    
    cy.get('input[name="username"]').type('newuser');
    cy.get('input[name="email"]').type('newuser@example.com');
    cy.get('input[name="password"]').type('newpassword');
    cy.get('input[name="confirmPassword"]').type('newpassword');
    cy.get('button[type="submit"]').click();
    
    cy.url().should('include', '/login');
    cy.contains('Please log in to continue').should('be.visible');
  });
});

Post-Login Verification

Once a user logs in successfully, they should be redirected to the Logged In Successfully page.

Test Case 3: Verify Logged In Successfully Page

  • Confirm the URL is /logged-in-successfully

  • Verify the page title is "Logged In Successfully"

  • Ensure the message "Congratulations student. You successfully logged in!" is displayed

  • Verify the Log Out button is present and functional

Cypress Test Code:

describe('Logged In Successfully Page Tests', () => {
  it('should display success message after login', () => {
    cy.visit('https://practicetestautomation.com/practice-test-login/');
    
    cy.get('#username').type('student');
    cy.get('#password').type('Password123');
    cy.get('#submit').click();
    
    cy.url().should('include', '/logged-in-successfully');
    cy.contains('Congratulations student. You successfully logged in!').should('be.visible');
  });
  
  it('should log out successfully', () => {
    cy.get('a').contains('Log out').click();
    cy.url().should('include', '/practice-test-login/');
  });
});

Best Practices for Cypress Testing

  • Keep Tests Independent: Each test should be able to run on its own, without relying on other tests to pass first.

  • Clean the State: Ensure that the application is in a clean state before running each test. Use Cypress commands to reset the app state if necessary.

  • Test Edge Cases: Consider testing invalid inputs, network errors, and other edge cases to ensure your app behaves as expected in all scenarios.

Conclusion

Testing login and signup pages with Cypress can help automate the process of ensuring your app's authentication functionality works as expected. By writing simple tests for login, signup, and post-login verification, you can catch potential issues early and improve the overall reliability of your application.

Happy testing! 

Image: Martin Vorel / Wikimedia Commons (CC BY-SA 4.0)

Comments

Popular posts from this blog

Understanding SQL Query Execution Order

When writing SQL queries, understanding the execution order is crucial for writing efficient and optimized code. Many beginners assume that queries execute in the order they are written, but in reality, SQL follows a specific sequence of execution. SQL Execution Order SQL queries run in the following order: 1️⃣ FROM + JOIN 2️⃣ WHERE 3️⃣ GROUP BY 4️⃣ HAVING 5️⃣ SELECT (including window functions) 6️⃣ ORDER BY 7️⃣ LIMIT Let’s break down each step with examples. 1. FROM + JOIN (Data Retrieval) The SQL engine first retrieves data from the specified table(s) and applies any JOIN operations. 🔹 Example: SELECT employees.name, departments.department_name FROM employees JOIN departments ON employees.department_id = departments.id; Here, the JOIN happens before any filtering ( WHERE ) or grouping ( GROUP BY ). 2. WHERE (Filtering Data) Once data is retrieved, the WHERE clause filters rows before aggregation occurs. 🔹 Example: SELECT * FROM employees WHERE salary > 50000 ; Thi...

Top 5 React.js Performance Optimization Techniques (React 19)

React applications rarely start slow. They get slow gradually — a context provider here, an unmemoized list there — until someone opens the Profiler and finds a component re-rendering 400 times on a single keystroke. These are the five optimisations that actually move the needle, in the order you should reach for them. One warning before we start, because it's the most common mistake in this topic: measure before you optimise . Memoizing every component in your app makes it slower, not faster, because memoization itself costs memory and comparison time. 0. Measure First: The React Profiler Install React DevTools, open the Profiler tab, hit record, and interact with the slow part of your app. You get a flame graph showing exactly which components rendered and how long each took. Turn on "Highlight updates when components render" in DevTools settings too. If typing in a search box makes your entire page flash, you have a state-placement problem, and no amount ...

Best Practices for Securing Personal and Business Data in 2025

In today’s digital landscape, cybersecurity is more critical than ever. With increasing cyber threats, data breaches, and privacy concerns, individuals and businesses must take proactive steps to secure their data. This guide outlines the most effective security practices for 2025. 1. Implement Strong Authentication Measures Passwords alone are no longer sufficient to protect sensitive accounts. Instead, consider: ✅ Multi-Factor Authentication (MFA): Require users to verify their identity using an additional factor, such as an SMS code, authenticator app, or biometric authentication. ✅ Passkeys & Password Managers: Use passkeys where available and store strong, unique passwords in a secure password manager. 2. Encrypt Sensitive Data Encryption ensures that even if data is stolen, it remains unreadable without the decryption key. 🔹 Use end-to-end encryption (E2EE) for messages and emails. 🔹 Encrypt stored data on cloud services, external drives, and local machines. 🔹 Consider ...