forked from pierront/mylibrary-template
book
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# language: en
|
||||
|
||||
Feature: Manage books in the catalog
|
||||
|
||||
Background:
|
||||
Given the catalog has the following books:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782016289308 | Le Petit Prince | Antoine de Saint-Exupéry | Gallimard | 1943-04-06 | 12.90 | 10 | Roman;Jeunesse | Un classique | FR |
|
||||
| 9782070409189 | L'Étranger | Albert Camus | Gallimard | 1942-05-19 | 9.50 | 5 | Roman | Roman philosophique | FR |
|
||||
|
||||
Scenario: Register a new book
|
||||
When I register a new book with the following information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782253006329 | Harry Potter à l'école des sorciers | J.K. Rowling | Pocket | 1998-10-09 | 8.20 | 20 | Fantaisie;Jeunesse | Premier tome de la saga | FR |
|
||||
Then a new book is created
|
||||
And the catalog now has 3 books
|
||||
And the book "9782253006329" has a stock of 20
|
||||
|
||||
Scenario: Retrieve a book by ISBN
|
||||
When I request the book with ISBN "9782016289308"
|
||||
Then I receive the following book information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782016289308 | Le Petit Prince | Antoine de Saint-Exupéry | Gallimard | 1943-04-06 | 12.90 | 10 | Roman;Jeunesse | Un classique | FR |
|
||||
|
||||
Scenario: Update a book information
|
||||
When I update book "9782070409189" with the following information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782070409189 | L'Étranger - Edition | Albert Camus | Gallimard | 1942-05-19 | 11.00 | 99 | Roman;Classique | Nouvelle édition commentée | FR |
|
||||
Then the book "9782070409189" has the following updated information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782070409189 | L'Étranger - Edition | Albert Camus | Gallimard | 1942-05-19 | 11.00 | 99 | Roman;Classique | Nouvelle édition commentée | FR |
|
||||
And the stock remains unchanged at 5
|
||||
|
||||
Scenario: Delete a book
|
||||
When I delete the book with ISBN "9782016289308"
|
||||
Then the book "9782016289308" is removed from the catalog
|
||||
And the catalog now has 1 books
|
||||
|
||||
Scenario: Attempt to register a book with invalid ISBN
|
||||
When I try to register a new book with the following information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 123456 | Livre test | Test Auteur | TestEdit | 2024-01-01 | 5.00 | 1 | Test | ISBN incorrect | FR |
|
||||
Then the book registration fails
|
||||
And I receive a validation book error message containing "ISBN is not valid"
|
||||
|
||||
Scenario: Attempt to register a book with invalid price
|
||||
When I try to register a new book with the following information:
|
||||
| isbn | titre | auteur | editeur | datePublication | prix | stockInitial | categories | description | langue |
|
||||
| 9782016289308 | Livre test | Test Auteur | TestEdit | 2024-01-01 | -5.00 | 1 | Test | Prix incorrect | FR |
|
||||
Then the book registration fails
|
||||
And I receive a validation book error message containing "Price must be positive"
|
||||
Reference in New Issue
Block a user