forked from lcetinsoy/mldash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_interface.js
31 lines (24 loc) · 1.08 KB
/
test_interface.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const houses = [
['206', '2', '0', 'Ouest', 254450],
['187', '1', '1', 'Est', 230594],
['194', '3', '1', 'Est', 271613],
];
describe('Case 1', () => {
it('should predict house 1', () => {
cy.visit('/');
const [size, nb_rooms, garden, _, price] = houses[0];
cy.get('input[aria-label="Taille maison"]').clear().type(size);
cy.get('input[aria-label="Nombre de chambre"]').clear().type(nb_rooms);
cy.get('input[aria-label="Y a un jardin"]').clear().type(garden);
cy.get('#result').invoke('text').then(parseInt).should('eq', price);
});
it('should predict all remaining houses', () => {
houses.slice(1).forEach(([size, nb_rooms, garden, _, price]) => {
cy.visit('/');
cy.get('input[aria-label="Taille maison"]').clear().type(size);
cy.get('input[aria-label="Nombre de chambre"]').clear().type(nb_rooms);
cy.get('input[aria-label="Y a un jardin"]').clear().type(garden);
cy.get('#result').invoke('text').then(parseInt).should('eq', price);
});
});
});