Odoo18-Base/addons/test_website/static/tests/tours/json_auth.js
2025-03-10 10:52:11 +07:00

25 lines
695 B
JavaScript

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