1441 |
ariadna |
1 |
@report @core_ai @core_ai_reports
|
|
|
2 |
Feature: AI reports
|
|
|
3 |
In order to view an AI report
|
|
|
4 |
As an admin or system role manager
|
|
|
5 |
I need to populate relevant data and navigate to the report page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| manager1 | Manager | One | manager1@example.com |
|
|
|
11 |
And the following "role assigns" exist:
|
|
|
12 |
| user | role | contextlevel | reference |
|
|
|
13 |
| manager1 | manager | System | |
|
|
|
14 |
And the following config values are set as admin:
|
|
|
15 |
| enabled | 1 | aiplacement_editor |
|
|
|
16 |
| generate_text | 1 | aiplacement_editor |
|
|
|
17 |
| generate_image | 0 | aiplacement_editor |
|
|
|
18 |
And the following "core_ai > ai providers" exist:
|
|
|
19 |
|provider | name | enabled | apikey | orgid |
|
|
|
20 |
|aiprovider_openai | OpenAI API test | 1 | 123 | abc |
|
|
|
21 |
|
|
|
22 |
@javascript @editor_tiny
|
|
|
23 |
Scenario: Mangers with a system role can see who has accepted the AI policy
|
|
|
24 |
Given I am logged in as "admin"
|
|
|
25 |
# Accept the AI policy as admin.
|
|
|
26 |
And I open my profile in edit mode
|
|
|
27 |
And I select the "p" element in position "0" of the "Description" TinyMCE editor
|
|
|
28 |
And I expand all toolbars for the "Description" TinyMCE editor
|
|
|
29 |
And I click on the "AI generate text" button for the "Description" TinyMCE editor
|
|
|
30 |
And I click on "Accept and continue" "button" in the "AI usage policy" "dialogue"
|
|
|
31 |
And I press the escape key
|
|
|
32 |
# Accept the AI policy as manager1.
|
|
|
33 |
And I am logged in as "manager1"
|
|
|
34 |
And I open my profile in edit mode
|
|
|
35 |
And I select the "p" element in position "0" of the "Description" TinyMCE editor
|
|
|
36 |
And I expand all toolbars for the "Description" TinyMCE editor
|
|
|
37 |
And I click on the "AI generate text" button for the "Description" TinyMCE editor
|
|
|
38 |
And I click on "Accept and continue" "button" in the "AI usage policy" "dialogue"
|
|
|
39 |
And I press the escape key
|
|
|
40 |
# View the report.
|
|
|
41 |
When I navigate to "Reports > AI reports > AI policy acceptance" in site administration
|
|
|
42 |
Then I should see "Admin User" in the "reportbuilder-table" "table"
|
|
|
43 |
And I should see "Manager One" in the "reportbuilder-table" "table"
|
|
|
44 |
# Test date filter (check last 1 day).
|
|
|
45 |
And I click on "Filters" "button"
|
|
|
46 |
And I set the following fields in the "Date accepted" "core_reportbuilder > Filter" to these values:
|
|
|
47 |
| Date accepted operator | Last |
|
|
|
48 |
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
|
|
|
49 |
And I click on "Filters" "button"
|
|
|
50 |
And I should see "Admin User" in the "reportbuilder-table" "table"
|
|
|
51 |
And I should see "Manager One" in the "reportbuilder-table" "table"
|
|
|
52 |
# Test name filter.
|
|
|
53 |
And I click on "Filters" "button"
|
|
|
54 |
And I set the following fields in the "Full name" "core_reportbuilder > Filter" to these values:
|
|
|
55 |
| Full name operator | Is equal to |
|
|
|
56 |
| Full name value | Admin User |
|
|
|
57 |
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
|
|
|
58 |
And I click on "Filters" "button"
|
|
|
59 |
And I should see "Admin User" in the "reportbuilder-table" "table"
|
|
|
60 |
And I should not see "Manager One" in the "reportbuilder-table" "table"
|