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 autoupgrade test #12045

Merged
merged 1 commit into from
Jan 7, 2019
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
2 changes: 1 addition & 1 deletion tests/E2E/test/campaigns/common_scenarios/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
.then(() => client.waitAndSetValue(productPage.first_product_quantity, "4"))
.then(() => client.getTextInVar(CheckoutOrderPage.product_current_price, "first_basic_price"));
});
test('should click on "Add to cart" button ', () => client.waitForExistAndClick(CheckoutOrderPage.add_to_cart_button));
test('should click on "Add to cart" button ', () => client.waitForExistAndClick(CheckoutOrderPage.add_to_cart_button, 3000));
test('should click on proceed to checkout button 1', () => client.waitForVisibleAndClick(CheckoutOrderPage.proceed_to_checkout_modal_button));
/**
* This scenario is based on the bug described in this ticket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ scenario('Generate and check a Credit slips options ', () => {
scenario('Change the credit slip prefix ', client => {
test('should go to "Credit slip" page', () => client.goToSubtabMenuPage(Menu.Sell.Orders.orders_menu, Menu.Sell.Orders.credit_slips_submenu));
test('should change the credit slip prefix value', () => client.waitAndSetValue(CreditSlip.credit_slip_prefix_input, 'PrefixTest'));
test('should click on "Save" button', () => client.waitForExistAndClick(CreditSlip.save_button));
test('should click on "Save" button', () => client.waitForExistAndClick(CreditSlip.save_button, 2000));
test('should check the green validation message', () => client.checkTextValue(CreditSlip.green_validation, 'The settings have been successfully updated.', 'contain'));
}, 'common_client');
scenario('Verify the prefix value', client => {
test('should go to "Orders" page', () => client.goToSubtabMenuPage(Menu.Sell.Orders.orders_menu, Menu.Sell.Orders.orders_submenu));
test('should go to the created order', () => client.waitForExistAndClick(OrderPage.order_view_button.replace('%ORDERNumber', 1)));
test('should click on "DOCUMENTS" subtab', () => client.scrollWaitForExistAndClick(OrderPage.document_submenu));
test('should check the existence of "prefix value" ', async () => {
test('should click on "DOCUMENTS" subtab', async () => {
await client.pause(3000);
await client.waitForExistAndClick(OrderPage.document_submenu, 2000);
await client.pause(3000);
await client.getCreditSlipDocumentName(OrderPage.credit_slip_document_name);
});
test('should download the credit slip', () => client.waitForExistAndClick(OrderPage.credit_slip_document_name));
test('should check the existence of "prefix value" ', async () => {
await client.pause(3000);
await client.checkDocument(global.downloadsFolderPath, global.creditSlip, 'PrefixTest');
});
Expand Down
16 changes: 6 additions & 10 deletions tests/E2E/test/campaigns/install_upgrade/02_autoupgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ scenario('The shop installation', () => {
}, 'installation');

welcomeScenarios.findAndCloseWelcomeModal('installation');

scenario('paaaaaaaaaaaause', client => {
test('paaaaaaaaaaaause', () => client.pause(25000));
}, 'installation');

scenario('Install "Top-sellers block" and "New products block" modules From Cross selling', client => {
moduleCommonScenarios.installModule(client, ModulePage, AddProductPage, "ps_bestsellers");
moduleCommonScenarios.installModule(client, ModulePage, AddProductPage, "ps_newproducts");
Expand All @@ -69,17 +64,18 @@ scenario('The shop installation', () => {
test('should copy the downloaded RC to the auto upgrade directory', () => client.copyFileToAutoUpgrade(downloadsFolderPath, filename, rcTarget + "admin-dev/autoupgrade/download"));
}
test('should select the "Channel" option', () => client.waitAndSelectByValue(ModulePage.channel_select, "archive"));
test('should select the "Archive to use" option', () => client.waitAndSelectByValue(ModulePage.archive_select, global.filename));
test('should select the "Archive to use" option', () => client.waitAndSelectByValue(ModulePage.archive_select, global.filename, 2000));
test('should set the Number of the version you want to upgrade to', () => client.waitAndSetValue(ModulePage.version_number, global.filename.replace(".zip", "")));
test('should click on "save" button', () => client.waitForExistAndClick(ModulePage.save_button));
test('should verify the success message', () => client.waitForVisibleElement(ModulePage.save_message));
test('should click on "refresh the page" button', () => {
test('should click on "Upgrade PrestaShop now!" button', () => {
return promise
.then(() => client.moveToObject(ModulePage.upgrade_block))
.then(() => client.waitForExistAndClick(ModulePage.refresh_button));
.then(() => client.scrollTo(ModulePage.upgrade_block))
.then(() => client.waitForExistAndClick(ModulePage.upgrade_button, 50, 7000));

});
test('should click on "Upgrade PrestaShop now!" button', () => client.waitForExistAndClick(ModulePage.upgrade_button));
test('should wait until the Upgrade is finished', () => client.waitForExist(ModulePage.loader_tag, 310000));
test('should check that the Upgrade is finished without Warnings nor errors', () => client.checkAutoUpgrade());
test('should check the success message appear', () => client.checkTextValue(ModulePage.success_msg, 'Upgrade complete'));
}, 'installation');

Expand Down
11 changes: 11 additions & 0 deletions tests/E2E/test/clients/common_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,17 @@ class CommonClient {
return this.client
.pause(pause)
}

checkAutoUpgrade() {
fs.readFile(rcTarget + 'admin-dev/autoupgrade/tmp/log.txt', 'utf8', (err, content) => {
global.upgradeError = content.indexOf("upgradeDbError");
});
return this.client
.pause(2000)
.then(() => {
expect(global.upgradeError, "Upgrade process done, but some warnings/errors have been found").to.equal(-1)
});
}
}

module.exports = CommonClient;