Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
TMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
CC-IN2P3 Applications team
TMS
Commits
ea61b673
Commit
ea61b673
authored
1 year ago
by
ZZZ[GONE] PERRIER Guillaume
Browse files
Options
Downloads
Patches
Plain Diff
[DEFAULT] Home page test implementation.
parent
da7cf3f9
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
[PHP-UNIT] Complete performing CI test within the container and use it for...
Pipeline
#232948
passed
1 year ago
Stage: php
Stage: nginx
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tms/composer.json
+5
-1
5 additions, 1 deletion
tms/composer.json
tms/tests/Controller/DefaultControllerTest.php
+55
-0
55 additions, 0 deletions
tms/tests/Controller/DefaultControllerTest.php
with
60 additions
and
1 deletion
tms/composer.json
+
5
−
1
View file @
ea61b673
...
...
@@ -63,7 +63,11 @@
"App\\"
:
"src/"
}
},
"autoload-dev"
:
{
"psr-4"
:
{
"App\\Tests\\"
:
"tests/"
}
},
"replace"
:
{
"paragonie/random_compat"
:
"2.*"
,
"symfony/polyfill-ctype"
:
"*"
,
...
...
This diff is collapsed.
Click to expand it.
tms/tests/Controller/DefaultControllerTest.php
0 → 100644
+
55
−
0
View file @
ea61b673
<?php
namespace
App\Tests\Controller
;
use
PHPUnit\Framework\TestCase
;
use
Symfony\Bundle\FrameworkBundle\Test\WebTestCase
;
class
DefaultControllerTest
extends
WebTestCase
{
public
function
testHomepage
()
{
$client
=
static
::
createClient
();
$crawler
=
$client
->
request
(
'GET'
,
'/'
);
//======================== TAPES =========================
$tapesCard
=
$crawler
->
filter
(
'h2.card-title'
)
->
eq
(
0
);
$tapesCardTitle
=
$tapesCard
->
html
();
$this
->
assertEquals
(
'Tapes'
,
$tapesCardTitle
,
"Tapes card was not found."
);
$tapesCardNumber
=
$tapesCard
->
nextAll
()
->
html
();
$this
->
assertGreaterThan
(
0
,
$tapesCardNumber
,
"There is no tapes found."
);
$tapesCanevas
=
$crawler
->
filter
(
'#chartServices'
)
->
count
();
$this
->
assertEquals
(
1
,
$tapesCanevas
,
"Tapes chart was not found."
);
//======================== LIBRARIES =========================
$librariesCard
=
$crawler
->
filter
(
'h2.card-title'
)
->
eq
(
1
);
$librariesCardTitle
=
$librariesCard
->
html
();
$this
->
assertEquals
(
'Librairies'
,
$librariesCardTitle
,
"Libraries card was not found."
);
$librariesCardNumber
=
$librariesCard
->
nextAll
()
->
html
();
$this
->
assertGreaterThan
(
0
,
$librariesCardNumber
,
"There is no libraries found."
);
$librariesCanevas
=
$crawler
->
filter
(
'#chartStatuts'
)
->
count
();
$this
->
assertEquals
(
1
,
$librariesCanevas
,
"libraries chart was not found."
);
//======================== COMMANDS =========================
$CommandsCard
=
$crawler
->
filter
(
'h2.card-title'
)
->
eq
(
2
);
$commandsCardTitle
=
$CommandsCard
->
html
();
$this
->
assertEquals
(
'Commandes'
,
$commandsCardTitle
,
"Commands card was not found."
);
$commandsCardNumber
=
$CommandsCard
->
nextAll
()
->
html
();
$this
->
assertGreaterThan
(
0
,
$commandsCardNumber
,
"There is no commands found."
);
$commandsCanevas
=
$crawler
->
filter
(
'#chartModels'
)
->
count
();
$this
->
assertEquals
(
1
,
$commandsCanevas
,
"Commands chart was not found."
);
}
}
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