Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Web Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orlando Piñero
Web Frontend
Commits
293c3ae4
Commit
293c3ae4
authored
1 year ago
by
Orlando Piñero
Browse files
Options
Downloads
Patches
Plain Diff
first tests frontend
parent
4c94bcb0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
my-app/.env
+2
-1
2 additions, 1 deletion
my-app/.env
my-app/src/App.test.js
+0
-8
0 additions, 8 deletions
my-app/src/App.test.js
my-app/src/tests/frontendTests.test.js
+55
-0
55 additions, 0 deletions
my-app/src/tests/frontendTests.test.js
with
57 additions
and
9 deletions
my-app/.env
+
2
−
1
View file @
293c3ae4
REACT_APP_SERVER=https://127.0.0.1/api
\ No newline at end of file
REACT_APP_SERVER=https://127.0.0.1/api
FIREFOX_DRIVER=selenium driver/geckodriver.exe
\ No newline at end of file
This diff is collapsed.
Click to expand it.
my-app/src/App.test.js
deleted
100644 → 0
+
0
−
8
View file @
4c94bcb0
import
{
render
,
screen
}
from
'
@testing-library/react
'
;
import
App
from
'
./App
'
;
test
(
'
renders learn react link
'
,
()
=>
{
render
(
<
App
/>
);
const
linkElement
=
screen
.
getByText
(
/learn react/i
);
expect
(
linkElement
).
toBeInTheDocument
();
});
This diff is collapsed.
Click to expand it.
my-app/src/tests/frontendTests.test.js
0 → 100644
+
55
−
0
View file @
293c3ae4
const
{
Builder
,
By
,
Key
,
until
}
=
require
(
'
selenium-webdriver
'
);
const
firefox
=
require
(
'
selenium-webdriver/firefox
'
);
const
webdriver
=
process
.
env
.
FIREFOX_DRIVER
const
service
=
new
firefox
.
ServiceBuilder
(
webdriver
);
describe
(
"
Find Landing Page
"
,
()
=>
{
let
driver
beforeAll
(
async
()
=>
{
driver
=
new
Builder
().
forBrowser
(
'
firefox
'
).
setFirefoxService
(
service
).
build
();
})
afterAll
(
async
()
=>
{
await
driver
.
quit
();
})
it
(
"
should find the landing page
"
,
async
()
=>
{
await
driver
.
get
(
"
http://localhost:3000
"
)
const
landingPage
=
await
driver
.
wait
(
until
.
elementLocated
(
By
.
id
(
"
LandingPage
"
)),
5000
)
expect
(
landingPage
).
toBeDefined
();
console
.
log
(
"
Landing page found
"
)
})
})
describe
(
"
Find Login-Dialog-Button
"
,
()
=>
{
let
driver
beforeAll
(
async
()
=>
{
driver
=
new
Builder
().
forBrowser
(
'
firefox
'
).
setFirefoxService
(
service
).
build
();
})
afterAll
(
async
()
=>
{
await
driver
.
quit
();
})
it
(
"
should find the landing page
"
,
async
()
=>
{
await
driver
.
get
(
"
http://localhost:3000
"
)
const
loginDialogButton
=
await
driver
.
wait
(
until
.
elementLocated
(
By
.
id
(
"
OpenLoginDialogButton
"
)),
5000
)
expect
(
loginDialogButton
).
toBeDefined
();
console
.
log
(
"
OpenLoginDialogButton found
"
)
})
it
(
"
should be able to click the Login-Dialog-Button
"
,
async
()
=>
{
await
driver
.
get
(
"
http://localhost:3000
"
)
const
loginDialogButton
=
await
driver
.
wait
(
until
.
elementLocated
(
By
.
id
(
"
OpenLoginDialogButton
"
)),
5000
)
expect
(
loginDialogButton
.
isEnabled
()).
toBeTruthy
();
console
.
log
(
"
OpenLoginDialogButton can be clicked
"
)
})
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment