Skip to content

Commit

Permalink
Reverted behat fixtures to roughly what they were with minor improvem…
Browse files Browse the repository at this point in the history
…ents.

Removed unneccesary Given jobe sandbox enabled lines.
Removed the hack in jobesandbox.php in prep for merging with branch
that has fixed the problem of reverting back to coderunner's default
jobe2 server (jobe2.cosc.canterbury.ac.nz) during bhat tests.
  • Loading branch information
mckeownp committed Mar 5, 2024
1 parent 7629ae0 commit d363a18
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ NonRepoFiles/*
/amd/src/ui_blockly.json
/amd/src/.eslintrc.js
.grunt

.vscode
2 changes: 1 addition & 1 deletion classes/jobesandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private function get_main_class($prog) {
}
}



// Return the sandbox error code corresponding to the given httpcode.
private function get_error_code($httpcode) {
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/backup_and_restore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Duplicate a course containing a CodeRunner question
I need to be able to back them up and restore them

Background:
And the following "courses" exist:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "question categories" exist:
Expand Down
23 changes: 21 additions & 2 deletions tests/behat/behat_coderunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,30 @@ class behat_coderunner extends behat_base {
* @Given /^the CodeRunner sandbox is enabled/
*/
public function the_coderunner_sandbox_is_enabled() {
set_config('wsenabled', 1, 'qtype_coderunner');
set_config('jobesandbox_enabled', 1, 'qtype_coderunner');
set_config('jobe_host', '172.17.0.1:4000', 'qtype_coderunner');
}


/**
* Sets the webserver scratchpad to enabled for testing purposes.
*
* @Given /^the CodeRunner scratchpad is enabled/
*/
public function the_coderunner_scratchpad_is_enabled() {
set_config('wsenabled', 1, 'qtype_coderunner');
}


/**
* Sets the webserver scratchpad to disabled for testing purposes.
*
* @Given /^the CodeRunner scratchpad is disabled/
*/
public function the_coderunner_scratchpad_is_disabled() {
set_config('wsenabled', 0, 'qtype_coderunner');
}


/**
* Checks that a given string appears within answer textarea.
* Intended for checking UI serialization
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/scratchpad_ui_params.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Feature: Test the Scratchpad UI, UI Params
I should be able specify the UI Parameters to change the Scratchpad UI

Background:
Given the following "users" exist:
Given the CodeRunner scratchpad is enabled
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exist:
Expand All @@ -20,7 +21,6 @@ Feature: Test the Scratchpad UI, UI Params
And the following "questions" exist:
| questioncategory | qtype | name | template |
| Test questions | coderunner | Print answer | printans |
And the CodeRunner sandbox is enabled

And I am on the "Print answer" "core_question > edit" page logged in as teacher1
And I set the field "id_validateonsave" to ""
Expand Down

0 comments on commit d363a18

Please sign in to comment.