Skip to content

Instantly share code, notes, and snippets.

Feature: user login
As a user
I want to log into my account
So that I can have access to my plan
Scenario: try to login with invalid credentials
Given the user has browsed to the login page
When the user tries to login with email "joe@yahoo.com" and password "Password@123" using the webUI
const {
setDefaultTimeout,
AfterAll,
BeforeAll,
Before,
After,
} = require('@cucumber/cucumber')
const {
startWebDriver,
stopWebDriver,
# staff.feature
# this is a background keyword learn more here: https://cucumber.io/docs/gherkin/reference/#background
Background:
Given a company has been created with following information and default attributes
# this is a data table you can learn more from: https://dev.to/jankaritech/datatables-used-in-a-gherkin-feature-file-2i89
| email | pkrwaste@gmail.com |
| mobileNo | 9816564565 |
| password | password |
And super admin has accepted the company
And company has logged in with email "" and password "" using the webUI
/Organization
org-login-header
org-login-email
org-login-password
org-login-submit
org-login-password-error
org-login-email-error
org-login-submit-error
/Dashboard/Home
<!-- ./public/index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cat Paws</title>
</head>
<body>
<div>
<h1 style="text-align: center;">Cat Paws</h1>
<!-- ./public/cats.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cat Paws</title>
</head>
<body>
<h1 style="text-align: center;">Cat-videos</h1>
<div style="display: flex; justify-content: center;">
@sakshamgurung
sakshamgurung / WebServer.java
Created February 7, 2022 15:02
Imports for WebServer.java
// Inside WebServer.java file
// Some necessary imports
import java.net.*;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.NoSuchAlgorithmException;
@sakshamgurung
sakshamgurung / WebServer.java
Created February 7, 2022 15:03
Webserver class
// Inside WebServer.java file
public class WebServer{
public static void main (String args[]) throws IOException NoSuchAlgorithmException {
int serverPort = 9090;
// allocating resources for server's socket and assigning a port number
ServerSocket listenSocket = new ServerSocket(serverPort);
try{
System.out.println("Server program started...");
while(true) {
// listening to the assigned port number and accepting
@sakshamgurung
sakshamgurung / WebServer.java
Created February 7, 2022 15:05
Connection class part I
// Inside WebServer.java file
// Thread class is extended to use multi-threading facility
class Connection extends Thread {
DataInputStream in;
DataOutputStream out;
Socket clientSocket;
public Connection (Socket clientSocket) {
try {
this.clientSocket = clientSocket;
@sakshamgurung
sakshamgurung / WebServer.java
Created February 7, 2022 15:06
Connection class part II
// continue Connection class...
// overiding run method from Thread class
public void run(){
// Initializing a Scanner class to read stream input from the
// socket connection between server and client
Scanner scan = new Scanner(this.in, "UTF-8");
try{
// separating the HTTP request header from rest of the HTTP message
// "\\r\\n\\r\\n" below refers to the 'empty line' from fig.1