This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
setDefaultTimeout, | |
AfterAll, | |
BeforeAll, | |
Before, | |
After, | |
} = require('@cucumber/cucumber') | |
const { | |
startWebDriver, | |
stopWebDriver, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ./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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ./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;"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
OlderNewer