Skip to content

Commit

Permalink
build: add e2e test site for Jamaican Psalms (+ misc below)
Browse files Browse the repository at this point in the history
 - temporarily point e2e tests to ba-wxp32b (which is currently a lubuntu selenium server)
 - fix copy error in questions settings test
 - add phpinfo to root (not in production web folder)
  • Loading branch information
irahopkinson committed Oct 16, 2015
1 parent 9f4a70e commit 44e9478
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<property name="build.installPath" value="/var/www/${application.name}.org_dev" />
<property name="build.installForTestPath" value="/var/www/${application.name}.org_e2etest" />
<property name="build.uploadPath" value="/var/www/${application.name}.org" />
<property name="e2etest.selenium.server.host" value="ba-wxp32c.psonet" />
<property name="e2etest.selenium.server.host" value="ba-wxp32b.psonet" />
<property name="e2etest.selenium.server.port" value="4444" />
<property name="e2etest.webserver.host" value="e2etest.${application.name}.local" />
<property name="e2etest.protractor.conf" value="protractorConf.${application.name}.js" /> <!-- Filename with base dir test/app/ -->
Expand Down
3 changes: 3 additions & 0 deletions phpinfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

phpinfo();
15 changes: 14 additions & 1 deletion src/Api/Library/Shared/Website.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ class Website
* @var array<Website>
*/
private static $_sites;

/**
*
* @var array
*/
private static $_redirect;

/**
*/
* @param string $domain
* @param string $base
* @throws \Exception
*/
public function __construct($domain, $base)
{
if ($base != self::SCRIPTUREFORGE && $base != self::LANGUAGEFORGE) { throw new \Exception('website->base must be either scriptureforge or languageforge'); }
Expand Down Expand Up @@ -121,6 +126,7 @@ private static function getHostname()
/**
* @param string $hostname
* @return string
* @throws \Exception
*/
public static function getRedirect($hostname = '')
{
Expand Down Expand Up @@ -255,6 +261,13 @@ public static function init()
$w->defaultProjectCode = 'jamaicanpsalms';
$sites['jamaicanpsalms.scriptureforge.local'] = $w;

$w = new Website('jamaicanpsalms.e2etest.scriptureforge.local', self::SCRIPTUREFORGE);
$w->name = 'The Jamaican Psalms Project';
$w->ssl = true;
$w->theme = 'jamaicanpsalms';
$w->defaultProjectCode = 'jamaicanpsalms';
$sites['jamaicanpsalms.e2etest.scriptureforge.local'] = $w;

$w = new Website('demo.scriptureforge.local', self::SCRIPTUREFORGE);
$w->name = 'Scripture Forge';
$w->ssl = true;
Expand Down
44 changes: 23 additions & 21 deletions test/app/scriptureforge/sfchecks/e2e/questionsSettingsPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ afterEach(function() {
});
*/

describe('the project settings page - project manager', function() {
var constants = require('../../../testConstants.json');
var loginPage = require('../../../bellows/pages/loginPage.js');
var util = require('../../../bellows/pages/util.js');
describe('the questions settings page - project manager', function() {
var constants = require('../../../testConstants.json');
var loginPage = require('../../../bellows/pages/loginPage.js');
var util = require('../../../bellows/pages/util.js');
var projectListPage = require('../../../bellows/pages/projectsPage.js');
var header = require('../../../bellows/pages/pageHeader.js');
var projectPage = require('../pages/projectPage.js');
var textPage = require('../pages/textPage.js');
var page = require('../pages/textSettingsPage.js');

var projectPage = require('../pages/projectPage.js');
var textPage = require('../pages/textPage.js');
var page = require('../pages/textSettingsPage.js');

it('setup: logout, login as project manager, go to text settings', function() {
loginPage.logout();
loginPage.loginAsManager();
Expand All @@ -25,33 +24,36 @@ describe('the project settings page - project manager', function() {
projectPage.textLink(constants.testText1Title).click();
textPage.textSettingsBtn.click();
});

describe('edit text tab', function() {

it('setup: click on tab', function() {
expect(page.tabs.editText.isPresent()).toBe(true);
page.tabs.editText.click();
});

it('can edit text content', function() {
// TODO: Use actual USX from projectPage.testData (maybe move it to testConstants) for this test, then verify it shows up properly on the question page
page.editTextTab.contentEditor.sendKeys('Hello, world!');
page.editTextTab.letMeEditLink.click();

// Should pop up two alerts in a row
// First alert: "This is dangerous, are you sure?"
util.checkModalTextMatches('Caution: Editing the USX text can be dangerous');
util.clickModalButton('Edit');

// Second alert: "You have previous edits which will be replaced, are you really sure?"
util.checkModalTextMatches('Caution: You had previous edits in the USX text box');
util.clickModalButton('Replace');

// TODO: Check alert text for one or both alerts (see http://stackoverflow.com/a/19884387/2314532)
expect(page.editTextTab.contentEditor.getAttribute('value')).toBe(constants.testText1Content);
});

});

// The Archived Questions tab is tested as part of a process in the Text (Questions) page tests. IJH 2014-06

describe('audio file tab - NYI', function() {
});

Expand All @@ -61,11 +63,11 @@ describe('the project settings page - project manager', function() {
expect(page.tabs.paratextExport.isPresent()).toBe(true);
page.tabs.paratextExport.click();
});

it('get a message since there are not messages flagged for export', function() {
expect(page.paratextExportTab.exportAnswers.getAttribute('checked')).toBeTruthy;
expect(page.paratextExportTab.exportAnswers.getAttribute('checked')).toBeTruthy();
expect(page.paratextExportTab.exportComments.getAttribute('checked')).toBeFalsy();
expect(page.paratextExportTab.exportFlagged.getAttribute('checked')).toBeTruthy;
expect(page.paratextExportTab.exportFlagged.getAttribute('checked')).toBeTruthy();
expect(page.paratextExportTab.downloadButton.isDisplayed()).toBe(false);
expect(page.paratextExportTab.prepareButton.isPresent()).toBe(true);
page.paratextExportTab.prepareButton.click();
Expand All @@ -76,21 +78,21 @@ describe('the project settings page - project manager', function() {
page.paratextExportTab.exportFlagged.click();
page.paratextExportTab.prepareButton.click();
expect(page.paratextExportTab.answerCount.isDisplayed()).toBe(true);
expect(page.paratextExportTab.answerCount.getText()).toEqual("2 answer(s)");
expect(page.paratextExportTab.answerCount.getText()).toEqual('2 answer(s)');
expect(page.paratextExportTab.commentCount.isDisplayed()).toBe(false);
expect(page.paratextExportTab.downloadButton.isDisplayed()).toBe(true);
});

it('can prepare export for all answers with comments', function() {
page.paratextExportTab.exportComments.click();
page.paratextExportTab.prepareButton.click();
expect(page.paratextExportTab.answerCount.isDisplayed()).toBe(true);
expect(page.paratextExportTab.answerCount.getText()).toEqual("2 answer(s)");
expect(page.paratextExportTab.answerCount.getText()).toEqual('2 answer(s)');
expect(page.paratextExportTab.commentCount.isDisplayed()).toBe(true);
expect(page.paratextExportTab.commentCount.getText()).toEqual("2 comment(s)");
expect(page.paratextExportTab.commentCount.getText()).toEqual('2 comment(s)');
expect(page.paratextExportTab.downloadButton.isDisplayed()).toBe(true);
});

});

});

0 comments on commit 44e9478

Please sign in to comment.