Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update delete shopping cart test #12104

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {Menu} = require('../../../selectors/BO/menu.js');
const {AccessPageBO} = require('../../../selectors/BO/access_page');
const {productPage} = require('../../../selectors/FO/product_page');
const {CheckoutOrderPage} = require('../../../selectors/FO/order_page');
const {OrderPage} = require('../../../selectors/BO/order');
const {OrderPage, ShoppingCart} = require('../../../selectors/BO/order');
const {CatalogPage} = require('../../../selectors/BO/catalogpage/index');
const commonOrder = require('../../common_scenarios/order');
let promise = Promise.resolve();
Expand Down Expand Up @@ -41,10 +41,17 @@ scenario('Delete shopping carts', () => {
});
test('should go to "Shopping cart" page', () => client.goToSubtabMenuPage(Menu.Sell.Orders.orders_menu, Menu.Sell.Orders.shopping_carts_submenu));
test('should check that the cart is not ordered yet', () => client.checkTextValue(OrderPage.check_order_id, 'Non ordered'));
test('should get the "ID" of the last shopping cart', () => client.getTextInVar(ShoppingCart.id.replace('%NUMBER', 1).replace('%COL', 2), "idShoppingCart"));
test('should click on "Dropdown" button', () => client.waitForExistAndClick(OrderPage.dropdown_button));
test('should click on "Delete" action', () => client.waitForExistAndClick(OrderPage.delete_button));
test('should accept the confirmation alert', () => client.alertAccept());
test('should verify the appearance of the green validation', () => client.checkTextValue(CatalogPage.success_panel, '×\nSuccessful deletion.'));
test('should check that this shopping carts does not appears in the list', () => {
return promise
.then(() => client.searchByValue(ShoppingCart.filter_id_input, ShoppingCart.search_button, global.tab['idShoppingCart']))
.then(() => client.checkTextValue(ShoppingCart.id.replace('%NUMBER', 1).replace('%COL', 1), 'No records found', 'contain'))
.then(() => client.waitForExistAndClick(ShoppingCart.reset_button));
});
}, 'order');
scenario('Create a new order from the Front Office', client => {
test('should go back to the Front office', () => {
Expand All @@ -60,7 +67,7 @@ scenario('Delete shopping carts', () => {
.then(() => client.refresh())
});
test('should go to "Shopping cart" page', () => client.goToSubtabMenuPage(Menu.Sell.Orders.orders_menu, Menu.Sell.Orders.shopping_carts_submenu));
test('should check that th "Dropdown" button does not exist', () => client.isNotExisting(OrderPage.first_dropdown_button,2000));
test('should check that th "CheckBox" does not exist', () => client.isNotExisting(OrderPage.first_shopping_cart_checkbox,2000));
test('should check that th "Dropdown" button does not exist', () => client.isNotExisting(OrderPage.first_dropdown_button, 2000));
test('should check that th "CheckBox" does not exist', () => client.isNotExisting(OrderPage.first_shopping_cart_checkbox, 2000));
}, 'order');
}, 'order', true);
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* This script is based on the scenario described in this test link
* [id="PS-153"][Name="By IP Adress"]
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-153
**/
const {AccessPageBO} = require('../../../../../selectors/BO/access_page');
const {Localization} = require('../../../../../selectors/BO/international/localization');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* [id="PS-160"][Name="Edit a zone"]
* [id="PS-161"][Name="Delete a zone"]
* [id="PS-162"][Name="Bulk actions"]
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-159
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-160
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-161
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-162
**/

const {AccessPageBO} = require('../../../../selectors/BO/access_page');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
* [id="PS-156"][Name="Add a country"]
* [id="PS-157"][Name="Edit a country"]
* [id="PS-158"][Name="Activate country restrictions"]
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-156
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-157
* http://testlink.prestashop.net/linkto.php?tprojectPrefix=PS&item=testcase&id=PS-158
**/

const {AccessPageBO} = require('../../../../selectors/BO/access_page');
Expand Down
2 changes: 1 addition & 1 deletion tests/E2E/test/selectors/BO/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ module.exports = {
id_shopping_carts: 'table-cart',
reset_button: '//*[@name="submitResetcart"]',
checkbox_input: '//*[@id="table-cart"]//input[@name="cartBox[]"]',
filter_id_input: '//*[@id="table-cart"]//input[@name="cartFilter_id_cart"]'
},

CreditSlip: {
Expand Down Expand Up @@ -147,4 +148,3 @@ module.exports = {
success_message: '//*[@id="main-div"]//div[@class="alert-text"]/p'
}
};