Wörter zum Testen angepasst
This commit is contained in:
parent
355a49bada
commit
654f07e723
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#testcafe firefox test/test.testcafe.js
|
||||
testcafe remote test/test.testcafe.js
|
||||
testcafe firefox test/test.testcafe.js
|
||||
#testcafe remote test/test.testcafe.js
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -37,7 +37,10 @@ class IndexController extends OnlineController
|
||||
|
||||
$wordsToCheck = [];
|
||||
for ($i = 0; $i < self::NUMBER_WORDS_TO_CHECK_SIMULTANEOUSLY; $i++) {
|
||||
$wordsToCheck[] = WordManager::wordToArray($wordManager->getRandomWordNotChecked(self::LENGTH_WORDS_MIN, self::LENGTH_WORDS_MAX));
|
||||
$word = $wordManager->getRandomWordNotChecked(self::LENGTH_WORDS_MIN, self::LENGTH_WORDS_MAX);
|
||||
if ($word != null) {
|
||||
$wordsToCheck[] = WordManager::wordToArray($word);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
@ -74,18 +77,30 @@ class IndexController extends OnlineController
|
||||
|
||||
$randomWordNotChecked = $wordManager->getRandomWordNotChecked(self::LENGTH_WORDS_MIN, self::LENGTH_WORDS_MAX);
|
||||
|
||||
if ($randomWordNotChecked != null) {
|
||||
return [
|
||||
WordManager::wordToArray($randomWordNotChecked),
|
||||
];
|
||||
}
|
||||
return [
|
||||
"id" => -1,
|
||||
"word" => "<i>Kein Wort mehr!</i>",
|
||||
// "created" => $word->getCreated()->format(SyncController::DATETIME_SYNC_FORMAT),
|
||||
// "lastUpdated" => $word->getLastUpdated()->format(SyncController::DATETIME_SYNC_FORMAT),
|
||||
// "language" => $word->getLang(),
|
||||
// "deleted" => $word->isDeleted(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getDoubleUsedWordsAction(){
|
||||
public function getDoubleUsedWordsAction()
|
||||
{
|
||||
/** @var LevelManager $levelManager */
|
||||
$levelManager = $this->get(LevelManager::class);
|
||||
return $levelManager->getDoubleUsedWords();
|
||||
}
|
||||
|
||||
public function deleteLevelAction(){
|
||||
public function deleteLevelAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
if (!$request->isPost()) {
|
||||
@ -105,7 +120,8 @@ class IndexController extends OnlineController
|
||||
return [];
|
||||
}
|
||||
|
||||
public function generateLevelsAction(){
|
||||
public function generateLevelsAction()
|
||||
{
|
||||
/** @var LevelManager $levelManager */
|
||||
$levelManager = $this->get(LevelManager::class);
|
||||
return ["levelsGenerated" => $levelManager->generateLevels()];
|
||||
|
||||
@ -19,6 +19,16 @@ const checkMatrix = async (matrixString, shouldValues) => {
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const convertMatrix = async (matrixString) => {
|
||||
let values = (await matrixString).substring(7,matrixString.length -1).split(",");
|
||||
let delta = 0.0001;
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
if (-delta <= values[i] && values[i] <= delta){
|
||||
values[i] = 0;
|
||||
}
|
||||
}
|
||||
return "matrix("+values.join(",")+")";
|
||||
};
|
||||
|
||||
const goBack = ClientFunction(() => window.history.back());
|
||||
const testLocalStorageSet = ClientFunction((key, value) => {
|
||||
@ -128,7 +138,7 @@ test.only('Play', async t => {
|
||||
levelNumber++;
|
||||
//first Level
|
||||
await t.debug();
|
||||
await t.expect(Selector('.segment.segment-parent.rotate-90').nth(0).getStyleProperty('transform')).eql("matrix(0, 1, -1, 0, 0, 0)")
|
||||
await t.expect(convertMatrix(Selector('.segment.segment-parent.rotate-90').nth(0).getStyleProperty('transform'))).eql("matrix(0, 1, -1, 0, 0, 0)")
|
||||
.expect(Selector('.segment.segment-parent.rotate-90').nth(1).getStyleProperty('transform')).eql("matrix(0, 1, -1, 0, 0, 0)")
|
||||
.expect(Selector('.segment.segment-parent.rotate-270').getStyleProperty('transform')).eql("matrix(0, -1, 1, 0, 0, 0)")
|
||||
.expect(Selector('#won-text').visible).eql(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user