-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix language switching and login/logout in SALSAH (#331)
* fix (salsah): Fix language switching and login/logout (ongoing, #316). * fix (salsah): Fix language change and login/logout (#316). * feature (webapi): Clarify alert box warning before language change. * test: Add language change test.
- Loading branch information
Benjamin Geer
authored
Nov 28, 2016
1 parent
0ffbf84
commit 4c61185
Showing
10 changed files
with
217 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
salsah/src/test/scala/org.knora.salsah/browser/InternationalizationSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.knora.salsah.browser | ||
|
||
import akka.actor.ActorSystem | ||
import akka.util.Timeout | ||
|
||
import scala.concurrent.duration._ | ||
|
||
/** | ||
* Tests the internationalization of the SALSAH GUI. | ||
*/ | ||
class InternationalizationSpec extends SalsahSpec { | ||
/* | ||
We use the Selenium API directly instead of the ScalaTest wrapper, because the Selenium API is more | ||
powerful and more efficient. | ||
See https://selenium.googlecode.com/git/docs/api/java/index.html?org/openqa/selenium/WebDriver.html | ||
for more documentation. | ||
*/ | ||
|
||
|
||
private val page = new SalsahPage | ||
|
||
// How long to wait for results obtained using the 'eventually' function | ||
implicit private val patienceConfig = page.patienceConfig | ||
|
||
implicit private val timeout = Timeout(180.seconds) | ||
|
||
implicit private val system = ActorSystem() | ||
|
||
implicit private val dispatcher = system.dispatcher | ||
|
||
private val rdfDataObjectsJsonList: String = | ||
""" | ||
[ | ||
{"path": "../knora-ontologies/knora-base.ttl", "name": "http://www.knora.org/ontology/knora-base"}, | ||
{"path": "../knora-ontologies/knora-dc.ttl", "name": "http://www.knora.org/ontology/dc"}, | ||
{"path": "../knora-ontologies/salsah-gui.ttl", "name": "http://www.knora.org/ontology/salsah-gui"}, | ||
{"path": "_test_data/ontologies/anything-onto.ttl", "name": "http://www.knora.org/ontology/anything"}, | ||
{"path": "_test_data/all_data/anything-data.ttl", "name": "http://www.knora.org/data/anything"} | ||
] | ||
""" | ||
|
||
// In order to run these tests, start `webapi` using the option `allowResetTriplestoreContentOperationOverHTTP` | ||
|
||
"The SALSAH home page" should { | ||
"load test data" in { | ||
loadTestData(rdfDataObjectsJsonList) | ||
} | ||
|
||
"change the user interface language" in { | ||
page.load() | ||
page.getSimpleSearchField.getAttribute("value") should be("Search") | ||
page.changeLanguage("fr") | ||
page.getSimpleSearchField.getAttribute("value") should be("Recherche") | ||
} | ||
} | ||
} |
Oops, something went wrong.