Commit 47dcb948 by vindarel

e2e test search results: page loads, we can search and see results

parent 61b7fb70
Pipeline #8379659 failed with stage
in 9 minutes 0 seconds
......@@ -220,7 +220,7 @@ test: unit ods testscrapers
testcafe:
# Firefox has pbs with the new syntax (async/await).
cd search/tests/integration-tests/ && testcafe chromium testcafetest.js
cd search/tests/integration-tests/ && testcafe chromium test*.js
# Build test virtual environments, test against multiple python versions.
# see tox.ini
......
// Copyright 2014 - 2017 The Abelujo Developers
// See the COPYRIGHT file at the top-level directory of this distribution
// Abelujo is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Abelujo is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Abelujo. If not, see <http://www.gnu.org/licenses/>.
import { Selector } from 'testcafe';
async function login (t) {
await t
.typeText('#id_username', 'admin')
.typeText('#id_password', 'admin')
.click('#submit_button');
};
fixture `search`
.page `http://localhost:8000/fr/search`
test('search and see results', async t => {
await login(t);
await t
.typeText('#default-input', 'antigone')
.click('#submit-button');
const cardsCount = await Selector('#card').count;
await t.expect(cardsCount).exists;
});
......@@ -50,7 +50,7 @@ div(ng-cloak, ng-show="cards", ng-controller="searchResultsController")
placeholder='{% trans "Search on title, authors or isbn" %}'
)
span.input-group-btn
button.btn.btn-primary(ng-click="validate()", type="submit", placeholder="{% trans 'Key words, or ean/isbn' %}") {% trans "Search" %}
button.btn.btn-primary#submit-button(ng-click="validate()", type="submit", placeholder="{% trans 'Key words, or ean/isbn' %}") {% trans "Search" %}
div.col-md-2
span  {% trans "or" %}: 
a(href="{% url 'card_edit' %}") {% trans "Add a card manually" %}
......@@ -89,7 +89,7 @@ div(ng-cloak, ng-show="cards", ng-controller="searchResultsController")
th
tbody
tr(ng-repeat="card in cards")
tr#card(ng-repeat="card in cards")
td
input(type="checkbox", ng-model="card.selected")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment