Skip to content
Permalink
Browse files
Created new scenario for 'E-profile.feature' and moved test images
Needed to test fucntionality of the profile page and moved test images to its own subfolder

Created new scenario 'change profile avatar' and moved test images to 'tests' subfolder in 'public/images'
  • Loading branch information
dhirk committed Nov 28, 2019
1 parent c064f2a commit 3817f23326e7cfcde1bd9d0c768096522c8bebd8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
@@ -3,8 +3,8 @@
<main>
<h1>Profile</h1>
<form action="/profile-action" enctype="multipart/form-data" method="post">
<p><input type="file" name="avatar"></p>
<p><input type="submit" value="Create"></p>
<p><input type="file" name="avatar" id="avatar-input"></p>
<p><input type="submit" value="Create" id="submit"></p>
</form>
</main>

@@ -13,7 +13,7 @@ rm -rf *.db
# [ ! -d "node_modules" ] && echo "INSTALLING MODULES" && npm install

# start the web server in background mode
# node index.js&
node index.js&

# run the test suite in background mode
node_modules/.bin/cucumber-js ./features -r ./steps &
@@ -1,17 +1,27 @@
Feature: Edit a profile
The user should be able to edit thier profile.
The user should be able to edit thier profile.

Scenario: profile page
Given The browser is open on the login page
When I click on the "login" field
And I enter "Vasper123" in the "username" field
And I enter "123" in the "password" field
And I click on the "submit" field
Given The browser is open on the login page
When I click on the "login" field
And I enter "Vasper123" in the "username" field
And I enter "123" in the "password" field
And I click on the "submit" field
And I click on the "profile" field
Then take a screenshot called "profile-page" in "profile"
And the first "title" should be "Game Hub | Sam Smith's Profile"
And the first "h1" should be "SAM SMITH'S PROFILE"

And the first "h1" should be "SAM SMITH'S PROFILE"
And the "h1" number "1" should be "Profile"

And the unordered list in header should be "Home Vasper123 Add Logout"

Scenario: change profile avatar
Given The browser is open on the login page
When I click on the "login" field
And I enter "Gamer123" in the "username" field
And I enter "1234" in the "password" field
And I click on the "submit" field
And I click on the "profile" field
And I enter image "public/images/tests/python-logo.png" in the "avatar-input" field
And I click on the "submit" field
Then take a screenshot called "avatar" in "profile"

@@ -13,7 +13,7 @@
"linter": "node_modules/.bin/eslint .",
"test": "jest --coverage --detectOpenHandles",
"unit": "node_modules/.bin/jest --coverage --runInBand tests/unit/",
"cucumber": "./cucumberTest.sh"
"cucumber": "cucumberTest.sh"
},
"jest": {
"projects": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3817f23

Please sign in to comment.