Skip to content

Commit

Permalink
Merge pull request #144 from Arquisoft/cucumber
Browse files Browse the repository at this point in the history
intento de cucumber
  • Loading branch information
UO264850 authored May 7, 2020
2 parents 1a0530b + 472774c commit 343e004
Show file tree
Hide file tree
Showing 4 changed files with 959 additions and 1 deletion.
3 changes: 3 additions & 0 deletions feature/addRoute.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Feature: Adding a Route

Scenario: The user wants to add the name, date and description for the Route
31 changes: 31 additions & 0 deletions feature/addRoute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const {defineFeature, loadFeature}= require('jest-cucumber');
const feature = loadFeature('./addRoute.feature');

defineFeature(feature, test => {
beforeEach(async () =>{
awaut page.goto('http://localhost:3000')
})

test('The user wants to add the name, date and description for the Route', ({given, when, then}) => {
given('The user', () =>{
webId = 'https://exampleuser.solid.community/profile/card#me';
});

when('I fill the name, date and description', async () => {
WebElement name = driver.findElement(By.name("name"));
WebElement description = driver.findElement(By.name("description"));
// Enter something to search for
name.sendKeys('route1');
description.sendKeys('description for route1');
// Now submit the form. WebDriver will find the form for us from the element
WebElement next = driver.findElement(By.type("submit"));
click_button(next);
});

then('Map page shoul show', () => {
await expect(page).toMatchElement('span', {text: ' Click on the map to add trackpoints to your route' });
});
});


});
Loading

0 comments on commit 343e004

Please sign in to comment.