Odoo18-Base/addons/test_website/static/tests/tours/json_auth.js
2025-01-06 10:57:38 +07:00

23 lines
634 B
JavaScript

/** @odoo-module **/
import { registry } from "@web/core/registry";
import { rpc } from "@web/core/network/rpc";
registry.category("web_tour.tours").add('test_json_auth', {
steps: () => [{
trigger: 'body',
run: async function () {
await rpc('/test_get_dbname').then( function (result){
return rpc("/web/session/authenticate", {
db: result,
login: 'admin',
password: 'admin'
});
});
window.location.href = window.location.origin;
},
}, {
trigger: 'span:contains(Mitchell Admin), span:contains(Administrator)',
}
]});