AutorÃa | Ultima modificación | Ver Log |
@core_ai @aiplacement_courseassistFeature: AI course assist featuresIn order to use AI course assist featuresAs a userI need to access a course and choose the desired AI featureBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | t1@example.com || teacher2 | Teacher | 2 | t2@example.com |And the following "courses" exist:| fullname | shortname | format || Course 1 | C1 | topics |And the following "roles" exist:| name | shortname | description | archetype || Custom editing teacher | custom1 | My custom role 1 | editingteacher || Custom teacher | custom2 | My custom role 2 | editingteacher |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | custom1 || teacher2 | C1 | custom2 |And the following "activities" exist:| activity | name | intro | introformat | course | content | contentformat | idnumber || page | PageName1 | PageDesc1 | 1 | C1 | PageContent | 1 | 1 |And the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || aiplacement/courseassist:summarise_text | Prohibit | custom2 | Course | C1 |And the following "core_ai > ai providers" exist:| provider | name | enabled | apikey | orgid || aiprovider_openai | OpenAI API test | 1 | 123 | abc |And the following config values are set as admin:| enabled | 1 | aiplacement_courseassist |Scenario: AI features dropdown is visible when more than one feature is enabledWhen I am on the "PageName1" "page activity" page logged in as teacher1Then "AI features" "button" should exist# Check nested buttons exist too.And "Summarise" "button" should existAnd "Explain" "button" should existScenario: AI features dropdown is not visible when only one feature is enabledGiven I set the following action configuration for ai provider with name "OpenAI API test":| action | enabled || explain_text | 0 || summarise_text | 1 |When I am on the "PageName1" "page activity" page logged in as teacher1Then "AI features" "button" should not existAnd "Explain" "button" should not exist# Only the summarise button should exist.And "Summarise" "button" should existScenario: AI features are not available if placement is not enabledGiven the following config values are set as admin:| enabled | | aiplacement_courseassist |When I am on the "PageName1" "page activity" page logged in as teacher1Then "AI features" "button" should not existScenario: AI features are not available if provider action is not enabledGiven I set the following action configuration for ai provider with name "OpenAI API test":| action | enabled || explain_text | 0 || summarise_text | 0 |When I am on the "PageName1" "page activity" page logged in as teacher1Then "AI features" "button" should not existScenario: AI features are not available if placement action is not enabledGiven I set the following action configuration for ai provider with name "OpenAI API test":| action | enabled || explain_text | 0 || summarise_text | 0 |When I am on the "PageName1" "page activity" page logged in as teacher1Then "AI features" "button" should not existScenario: AI features are not available if the user does not have permissionWhen I am on the "PageName1" "page activity" page logged in as teacher2Then "AI features" "button" should not exist@javascriptScenario: I can view the AI drawer contents using the AI features dropdownGiven I am on the "PageName1" "page activity" page logged in as teacher1When I click on "AI features" "button"And I click on "Summarise" "button"Then I should see "Welcome to the new AI feature!" in the ".ai-drawer" "css_element"