*: test_website, website_blog, website_crm, website_hr_recruitment, website_mass_mailing, website_sale, website_sale_wishlist, website_slides This commit creates a new util which clicks on edit and waits for the edit mode to be started. This way, we make sure that the edit mode is enabled before testing the next step of the test. This avoids race conditions during tests. This commit replaces all the uses of the old util with the new one, it also removes the steps that are waiting for the edit mode to start. Finally, from [this other commit], we can start a tour in edit mode. For these tests (which have `edition: true`), it is useless to check if the edit mode has started at the beginning of the test because this check is already done by default. This commit removes unnecessary / duplicated steps. [this other commit]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35#diff-c7720501ec33f5f92c907d8bb41de50edd832a4564317073e801a6915796a6bdR278 task-3203820 closes odoo/odoo#120481 X-original-commit: https://github.com/odoo/odoo/commit/9fd5d25f59578abc9c608578a7d2e2953880b582 Related: odoo/design-themes#656 Signed-off-by: Romain Derie (rde) <rde@odoo.com> Signed-off-by: Guillaume-gdi <gdi@odoo.com>
20 lines
747 B
Python
20 lines
747 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import odoo
|
|
import odoo.tests
|
|
|
|
|
|
@odoo.tests.common.tagged('post_install', '-at_install')
|
|
class TestSnippets(odoo.tests.HttpCase):
|
|
|
|
def test_01_newsletter_popup(self):
|
|
self.start_tour('/', 'newsletter_popup_edition', login='admin')
|
|
self.start_tour("/", "newsletter_popup_use", login=None)
|
|
mailing_list = self.env['mailing.list'].search([], limit=1)
|
|
emails = mailing_list.contact_ids.mapped('email')
|
|
self.assertIn("hello@world.com", emails)
|
|
|
|
def test_02_newsletter_block_edition(self):
|
|
self.start_tour(self.env['website'].get_client_action_url('/'), 'newsletter_block_edition', login='admin')
|