Skip to content

Commit

Permalink
ALLY-12: Fix behat tests for Moodle 4.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
gthomas2 committed Aug 23, 2024
1 parent bb0fd7c commit 789f23b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ jobs:
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Install NVM and Node
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20
nvm use 20
- name: Extract branch name
shell: bash
Expand All @@ -87,7 +94,9 @@ jobs:
# See https://moodlehq.github.io/moodle-plugin-ci/AddExtraConfig.html
# for adding extra config.php values via moodle-plugin-ci.
- name: Install moodle-plugin-ci
continue-on-error: false
run: |
echo "NOTE: Using branch ${{ steps.extract_branch.outputs.branch }}"
moodle-plugin-ci add-plugin --branch ${{ steps.extract_branch.outputs.branch }} $GITHUB_REPOSITORY_OWNER/moodle-tool_ally
moodle-plugin-ci add-plugin --branch ${{ steps.extract_branch.outputs.branch }} $GITHUB_REPOSITORY_OWNER/moodle-report_allylti
moodle-plugin-ci add-plugin --branch ${{ steps.extract_branch.outputs.branch }} $GITHUB_REPOSITORY_OWNER/moodle-mod_hsuforum
Expand Down
14 changes: 12 additions & 2 deletions tests/behat/behat_filter_ally.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,19 +1085,29 @@ public function module_with_html_is_annotated($modname, $html) {

/**
* @param string $title
* @Given html block with title ":title" is annotated
* @Then html block with title ":title" is annotated
*/
public function html_block_with_title_is_annotated($title) {
$this->wait_for_pending_js();
$selectors = [];
// Boost theme selector.
// Boost theme selector < Moodle 4.3
$selectors[] = <<<XPATH
//section[contains(@class, 'block_html')]
//div//h3[contains(@class, 'card-title')][contains(text(), '$title')]
/ancestor::section[contains(@class, 'block_html')]
//div[contains(@class, 'card-text')]
//div[@data-ally-richcontent]
XPATH;

// Boost theme selector >= Moodle 4.3
$selectors[] = <<<XPATH
//section[contains(@class, 'block_html')]
//div//h5[contains(text(), '$title')]
/ancestor::section[contains(@class, 'block_html')]
//div[contains(@class, 'card-text')]
//div[@data-ally-richcontent]
XPATH;

// Clean theme selector.
$selectors[] = <<<XPATH
//div//h2[contains(@id, 'instance')][contains(text(), '$title')]
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

/** @var stdClass $plugin */
$plugin->component = 'filter_ally';
$plugin->release = '4.3.0';
$plugin->version = 2024062700;
$plugin->release = '4.3.6';
$plugin->version = 2024082300;
$plugin->requires = 2022041900;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
Expand Down

0 comments on commit 789f23b

Please sign in to comment.