Skip to content

Commit

Permalink
WIP fix click search tour and fix javascript lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mathben committed Mar 8, 2020
1 parent df45647 commit beaa90f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 70 deletions.
137 changes: 69 additions & 68 deletions website_portal_contact/static/src/js/portal_contact.tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,79 @@
odoo.define('website_portal_contact.tour_test', function (require) {
'use strict';

var tour = require('web_tour.tour');
var core = require('web.core');
var base = require('web_editor.base');
var steps = [{
var tour = require('web_tour.tour');
// var core = require('web.core');
var base = require('web_editor.base');
var steps = [
{
content: 'Click to add Guybrush',
trigger: 'div.col-md-4.col-md-offset-4.mt8 > a',
waitFor: 'div.col-md-4.col-md-offset-4.mt8 > a',
position: 'top',
run: 'click'
run: 'click',
},
{
content: 'Fill name "Guybrush Threpwood"',
trigger: '#name',
run: 'text Guybrush Threpwood'
},
{
content: 'Fill phone',
trigger: '#phone',
run: 'text 987654321'
},
{
content: 'Fill mobile',
trigger: '#mobile',
run: 'text 123456789'
},
{
content: 'Fill email "[email protected]"',
trigger: '#email',
run: 'text [email protected]'
},
{
content: 'Save new contact Guybrush',
trigger: '#portal_contact > section > div > button',
run: 'click',
wait: 11500
},
{
content: 'Return to list',
trigger: 'a[href="/my/contacts"]',
run: 'click'
},
{
content: 'Search for Guybrush',
trigger: '#wrap > div > div.col-md-8 > div.row.mt16.mb16 > div:nth-child(1) > form > div > input',
waitFor: '#wrap > div > div.col-md-8 > div.row.mt16.mb16 > div:nth-child(1) > form > div > input',
position: 'top',
run: 'text guybrush'
},
{
content: 'Click search for Guybrush',
position: 'top',
trigger: '#wrap > div > div.col-md-8 > div.row.mt16.mb16 > div:nth-child(1) > form > div > span > button',
run: 'click'
},
{
content: 'Delete Guybrush',
trigger: 'tr:contains("Guybrush") td.text-center > a',
waitFor: 'tr:contains("Guybrush")',
run: 'click'
},
{
content: 'Return to list',
trigger: 'a[href="/my/contacts"]',
run: 'click'
}
];
{
content: 'Fill name "Guybrush Threpwood"',
trigger: '#name',
run: 'text Guybrush Threpwood',
},
{
content: 'Fill phone',
trigger: '#phone',
run: 'text 987654321',
},
{
content: 'Fill mobile',
trigger: '#mobile',
run: 'text 123456789',
},
{
content: 'Fill email "[email protected]"',
trigger: '#email',
run: 'text [email protected]',
},
{
content: 'Save new contact Guybrush',
trigger: '#portal_contact > section > div > button',
run: 'click',
wait: 11500,
},
{
content: 'Return to list',
trigger: 'a[href="/my/contacts"]',
run: 'click',
},
{
content: 'Search for Guybrush',
trigger: '#wrap > div.container.mb64 > div.row.mt16.mb16 > div.col-md-4.mt8 > form > div > input',
waitFor: '#wrap > div.container.mb64 > div.row.mt16.mb16 > div.col-md-4.mt8 > form > div > input',
position: 'top',
run: 'text guybrush',
},
{
content: 'Click search for Guybrush',
position: 'top',
trigger: '#wrap > div.container.mb64 > div.row.mt16.mb16 > div.col-md-4.mt8 > form > div > span > button',
run: 'click',
},
{
content: 'Delete Guybrush',
trigger: 'tr:contains("Guybrush") td.text-center > a',
waitFor: 'tr:contains("Guybrush")',
run: 'click',
},
{
content: 'Return to list',
trigger: 'a[href="/my/contacts"]',
run: 'click',
}
];

tour.register('test_website_portal_contact', {
test: true,
url: '/my/contacts',
wait_for: base.ready(),
'skip_enabled': true
},
steps)
tour.register('test_website_portal_contact', {
test: true,
url: '/my/contacts',
wait_for: base.ready(),
'skip_enabled': true
},
steps);
});
6 changes: 4 additions & 2 deletions website_portal_contact/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
class TestUi(odoo.tests.HttpCase):
def test_01_demo_contact_tour(self):
self.phantom_js(url_path="/",
code="odoo.__DEBUG__.services['web_tour.tour'].run('test_website_portal_contact')",
ready="odoo.__DEBUG__.services['web_tour.tour'].tours.test_website_portal_contact.ready",
code="odoo.__DEBUG__.services['web_tour.tour']"
".run('test_website_portal_contact')",
ready="odoo.__DEBUG__.services['web_tour.tour']"
".tours.test_website_portal_contact.ready",
login="demo")

0 comments on commit beaa90f

Please sign in to comment.