Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288543 committed Apr 22, 2024
1 parent bc58db7 commit a0a4e65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webapp/e2e/steps/discoveringCitiesGame.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defineFeature(feature, test => {
await page.setRequestInterception(true);

page.on('request', (req) => {
if(req.url().endsWith('/Geography/en')) {
if(req.url().endsWith('/en/Cities')) {
req.respond({
status: 200,
headers: {
Expand Down
7 changes: 3 additions & 4 deletions webapp/e2e/steps/game.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ defineFeature(feature, test => {
test('Answering a question correctly', ({given,when,then}) => {

given('A question', async () => {
//await expect(page.findByText('Which is the capital of Spain?'));
const question = await page.$['data-testid="question"'];
await expect(page).toMatchElement("div", { text: 'Which is the capital of Spain?'});
expect(question).not.toBeNull();

await expect(page).toMatchElement("h4", { text: 'WHICH IS THE CAPITAL OF SPAIN?'});

const answers = await page.$x('//*[@data-testid="answer"]');
expect(answers.length).toBe(4);
});
Expand All @@ -94,7 +93,7 @@ defineFeature(feature, test => {
given('A question', async () => {
//await expect(page.findByText('Which is the capital of Spain?'));
const question = await page.$['data-testid="question"'];
await expect(page).toMatchElement("div", { text: 'Which is the capital of Spain?'});
await expect(page).toMatchElement("h4", { text: 'WHICH IS THE CAPITAL OF SPAIN?'});
expect(question).not.toBeNull();

const answers = await page.$x('//*[@data-testid="answer"]');
Expand Down

0 comments on commit a0a4e65

Please sign in to comment.