From 4db8c451f1a6f4d6a5fc5b757d32e9222d9f6cb3 Mon Sep 17 00:00:00 2001 From: Aakrity17 Date: Thu, 14 Dec 2023 13:43:09 +0545 Subject: [PATCH] Login feature sucessfully testedggg --- akriti/.gitignore | 2 ++ .../tests/acceptance/PageObject/EntityPage.js | 13 ++++++++++ .../tests/acceptance/features/entity.feature | 15 +++++++++++ .../tests/acceptance/features/login.feature | 4 +-- .../stepDefinitions/entityContext.js | 25 +++++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 akriti/tests/acceptance/PageObject/EntityPage.js create mode 100644 akriti/tests/acceptance/features/entity.feature create mode 100644 akriti/tests/acceptance/stepDefinitions/entityContext.js diff --git a/akriti/.gitignore b/akriti/.gitignore index e69de29b..3b2f7ed2 100644 --- a/akriti/.gitignore +++ b/akriti/.gitignore @@ -0,0 +1,2 @@ +./node_modules +./acceptance/stepDefinitions/NOTE.TXT \ No newline at end of file diff --git a/akriti/tests/acceptance/PageObject/EntityPage.js b/akriti/tests/acceptance/PageObject/EntityPage.js new file mode 100644 index 00000000..eadd9b64 --- /dev/null +++ b/akriti/tests/acceptance/PageObject/EntityPage.js @@ -0,0 +1,13 @@ +// const puppeteer =require('puppeteer') + +class EntityPage{ + constructor() { + + + + + } + + } + module.exports = EntityPage; + \ No newline at end of file diff --git a/akriti/tests/acceptance/features/entity.feature b/akriti/tests/acceptance/features/entity.feature new file mode 100644 index 00000000..c10105ea --- /dev/null +++ b/akriti/tests/acceptance/features/entity.feature @@ -0,0 +1,15 @@ +Feature: entity +As a user +I want to create files and folders +So I can manage the files and folders + +# Scenario: User Login with correct username and valid password +# When user logs in with username "admin" and password "admin" +# Then user should redirect to the homepage + + + Scenario: user create a file + Given the user has browsed to the login page + And user logged in with username "admin123" and password "12345" + When user creates a file "demo.txt" with content "hello world !!" + Then user should see the "demo.txt" file \ No newline at end of file diff --git a/akriti/tests/acceptance/features/login.feature b/akriti/tests/acceptance/features/login.feature index 5fb7821d..11742dc4 100644 --- a/akriti/tests/acceptance/features/login.feature +++ b/akriti/tests/acceptance/features/login.feature @@ -8,8 +8,8 @@ Background: Scenario: User Login with correct username and valid password - When user logs in with username "admin" and password "admin" - Then user should redirect to the homepage + When user logs in with username "admin" and password "admin" + Then user should redirect to the homepage Scenario Outline: login with invalid credendial diff --git a/akriti/tests/acceptance/stepDefinitions/entityContext.js b/akriti/tests/acceptance/stepDefinitions/entityContext.js new file mode 100644 index 00000000..51add02c --- /dev/null +++ b/akriti/tests/acceptance/stepDefinitions/entityContext.js @@ -0,0 +1,25 @@ +const { Given, When, Then } = require('@cucumber/cucumber'); +const { expect, test, _android } = require('@playwright/test'); +const assert = require("assert") + + + + + + +Given('user logged in with username {string} and password {string}', function (string, string2) { + // Write code here that turns the phrase above into concrete actions + return 'pending'; + }); + +When('user creates a file {string} with content {string}', function (string, string2) { + // Write code here that turns the phrase above into concrete actions + return 'pending'; + }); + Then('user should see the {string} file', function (string) { + // Write code here that turns the phrase above into concrete actions + return 'pending'; + }); + + +