Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
DummySolution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
DummySolution
Commits
0f0d5971
Commit
0f0d5971
authored
Oct 14, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Login Test
parent
e3d2d8f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
LoginTest.cs
test/Dummy.SeleniumTests/LoginTest.cs
+53
-0
No files found.
test/Dummy.SeleniumTests/LoginTest.cs
0 → 100644
View file @
0f0d5971
using
NUnit.Framework
;
using
OpenQA.Selenium
;
using
OpenQA.Selenium.Chrome
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Dummy.SeleniumTests
{
public
class
LoginTest
{
private
const
string
password
=
"SuperSecretPassword!"
;
private
const
string
userName
=
"tomsmith"
;
private
const
string
hostName
=
"https://the-internet.herokuapp.com/login"
;
[
Test
]
public
void
SignIn_ShouldBe_Successfull
()
{
// create the driver
var
driver
=
new
ChromeDriver
();
// navigate to the url
driver
.
Navigate
()
.
GoToUrl
(
hostName
);
// get the email input button
IWebElement
emailInput
=
driver
.
FindElement
(
By
.
Name
(
"username"
));
// get the password input button
IWebElement
passswordInput
=
driver
.
FindElement
(
By
.
Name
(
"password"
));
// enter the user name and password
emailInput
.
SendKeys
(
userName
);
passswordInput
.
SendKeys
(
password
);
// get the login form
IWebElement
form
=
driver
.
FindElement
(
By
.
Id
(
"login"
));
// submit the form
form
.
Submit
();
String
url
=
driver
.
Url
;
Assert
.
IsTrue
(
url
.
Contains
(
"secure"
));
// close the browser after finishing
driver
.
Close
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment