Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
open-source
MetaGer
Commits
f6147c43
Commit
f6147c43
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
fixed websearch page test
parent
271e9b53
No related branches found
No related tags found
2 merge requests
!2010
Development
,
!2001
Resolve "Improve Localization"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
metager/tests/Browser/Pages/WebsearchWidget.php
+11
-12
11 additions, 12 deletions
metager/tests/Browser/Pages/WebsearchWidget.php
metager/tests/Browser/StaticPagesTest.php
+2
-2
2 additions, 2 deletions
metager/tests/Browser/StaticPagesTest.php
with
13 additions
and
14 deletions
metager/tests/Browser/Pages/WebsearchWidget.php
+
11
−
12
View file @
f6147c43
...
...
@@ -3,6 +3,8 @@
namespace
Tests\Browser\Pages
;
use
Laravel\Dusk\Browser
;
use
Laravel\Dusk\Page
;
use
LaravelLocalization
;
class
WebsearchWidget
extends
Page
{
...
...
@@ -11,9 +13,9 @@ class WebsearchWidget extends Page
*
* @return string
*/
public
function
url
()
public
function
url
(
$locale
=
null
)
{
return
"/websearch
/
"
;
return
LaravelLocalization
::
getLocalizedUrl
(
$locale
,
"/websearch"
)
;
}
/**
...
...
@@ -24,17 +26,14 @@ class WebsearchWidget extends Page
*/
public
function
assert
(
Browser
$browser
)
{
$browser
->
assertPathIs
(
$this
->
url
())
->
waitForText
(
"Hier finden Sie ein Metager-Widget für Ihre Webseite."
)
->
assertTitle
(
"Websuche-Widget - MetaGer"
)
->
switchLanguage
(
"English"
)
->
waitForText
(
"Here you find a Metager-Widget for your website."
)
->
assertTitle
(
"Websearch-Widget - MetaGer"
)
->
switchLanguage
(
"Español"
)
->
waitForText
(
"Aquí encuentra el MetaGer-widget para su sitio web"
)
->
assertTitle
(
"Widget para buscar la web - MetaGer"
)
->
switchLanguage
(
"Deutsch"
);
foreach
(
LaravelLocalization
::
getSupportedLocales
()
as
$locale
=>
$locale_data
)
{
$url
=
$this
->
url
(
$locale
);
$lang
=
\preg_replace
(
"/^([a-zA-Z]+)-.*/"
,
"$1"
,
$locale
);
$browser
->
visit
(
$url
)
->
waitForText
(
trans
(
"websearch.head.2"
,
[],
$lang
))
->
assertTitle
(
trans
(
"titles.websearch"
,
[],
$lang
));
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
metager/tests/Browser/StaticPagesTest.php
+
2
−
2
View file @
f6147c43
...
...
@@ -161,7 +161,7 @@ class StaticPagesTest extends DuskTestCase
->
on
(
new
Widget
);
});
}
/*
public
function
testWebsearchWidget
()
{
// Websearch Widget
...
...
@@ -177,7 +177,7 @@ class StaticPagesTest extends DuskTestCase
->
on
(
new
WebsearchWidget
);
});
}
/*
public function testSitesearchWidget()
{
// Sitesearch Widget
...
...
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