Skip to content

Commit

Permalink
[Tests] Dockerized tests fix (aces#7319)
Browse files Browse the repository at this point in the history
Fix dockerized tests so that they can be run locally.
  • Loading branch information
laemtl authored Feb 12, 2021
1 parent 308657a commit e2ae079
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.test.php7.debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.2
FROM php:7.4

RUN apt-get update && \
apt-get install -y mariadb-client zlib1g-dev
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ services:
- MYSQL_RANDOM_ROOT_PASSWORD=yes

selenium:
image: selenium/standalone-firefox-debug:3.8.1-aluminum
image: selenium/standalone-firefox-debug:3.141.59-zirconium
volumes:
- /dev/shm:/dev/shm
ports:
- "5900:5900"
environment:
- SE_OPTS=-enablePassThrough false

web:
build:
Expand Down Expand Up @@ -66,7 +64,7 @@ services:
entrypoint: /app/test/wait-for-services.sh

selenium-debug:
image: selenium/standalone-firefox-debug:3.8.1-aluminum
image: selenium/standalone-firefox-debug:3.141.59-zirconium
links:
- web-debug:web
ports:
Expand Down
2 changes: 1 addition & 1 deletion modules/create_timepoint/test/create_timepointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function testCreateTimepointErrorEmptySubproject()
$this->safeGet(
$this->url . "/create_timepoint/?candID=900000&identifier=900000"
);
$this->webDriver->findElement(WebDriverBy::Name("fire_away"))->click();
$this->safeFindElement(WebDriverBy::Name("fire_away"))->click();
$bodyText = $this->webDriver->getPageSource();
$this->assertStringNotContainsString(
"New time point successfully registered.",
Expand Down
8 changes: 2 additions & 6 deletions modules/survey_accounts/test/survey_accountsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ function testSurveyAccountsAddSurvey()
// Ensure that an instrument must be supplied.
$this->safeGet($this->url . "/survey_accounts/");
$btn = self::$add;
$this->webDriver->executescript(
"document.querySelector('$btn').click()"
);
$this->safeFindElement(WebDriverBy::cssSelector($btn))->click();
$this->safeFindElement(
WebDriverBy::Name("CandID")
)->sendKeys("999999");
Expand All @@ -247,9 +245,7 @@ function testSurveyAccountsAddSurvey()
// Ensure visit label exists for a candidate.
$this->safeGet($this->url . "/survey_accounts/");
$btn = self::$add;
$this->webDriver->executescript(
"document.querySelector('$btn').click()"
);
$this->safeFindElement(WebDriverBy::cssSelector($btn))->click();
$this->safeFindElement(
WebDriverBy::Name("CandID")
)->sendKeys("999999");
Expand Down
9 changes: 4 additions & 5 deletions test/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@
<directory>../modules/user_accounts/test/</directory>
<directory>../test/test_instrument/</directory>
</testsuite>

</testsuites>
<!-- This is currently breaking the coverage.xml generation, so
for now it's disabled, but eventually we'll want to make
sure everything is tested.. -->

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<coverage>
<include>
<directory suffix=".inc">../php/libraries</directory>
<!-- CodeCov crashes because installer/ has classes with the same
name as libraries/, so for now we only cover libraries and
Expand All @@ -72,7 +71,7 @@
<!--directory suffix=".php">../htdocs</directory-->
<directory suffix=".inc">../modules/*/php</directory>
<!--directory>../modules/dashboard/ajax/</directory-->
</whitelist>
</filter>
</include>
</coverage>

</phpunit>

0 comments on commit e2ae079

Please sign in to comment.