forked from medic/cht-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate concatenate strings (medic#7333)
* migrate concatenate xpath strings * rename files
- Loading branch information
Showing
3 changed files
with
53 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const concatenateStrings = require('../page-objects/forms/concatenate-strings.wdio.page'); | ||
const common = require('../page-objects/common/common.wdio.page'); | ||
const constants = require('../constants'); | ||
const loginPage = require('../page-objects/login/login.wdio.page'); | ||
const reportsPage = require('../page-objects/reports/reports.wdio.page'); | ||
const { expect } = require('chai'); | ||
|
||
|
||
const userContactDoc = { | ||
_id: constants.USER_CONTACT_ID, | ||
name: 'Jack', | ||
date_of_birth: '', | ||
phone: '+64274444444', | ||
alternate_phone: '', | ||
notes: '', | ||
type: 'person', | ||
reported_date: 1478469976421, | ||
parent: { | ||
_id: 'some_parent', | ||
}, | ||
}; | ||
|
||
// If this test starts failing then we need to document in the release notes that we've removed the deprecated | ||
// feature allowing for concatenation of strings | ||
describe('Concatenate xpath strings', () => { | ||
before(async () => { | ||
await loginPage.cookieLogin(); | ||
await concatenateStrings.configureForm(userContactDoc); | ||
}); | ||
|
||
it('concatenates strings', async () => { | ||
await common.goToReports(); | ||
await reportsPage.openForm('Concatenate Strings'); | ||
const concatElement = await $('#concat'); | ||
await concatElement.waitForDisplayed(); | ||
const fullNameInput = await $('[name="/concatenate-strings/inputs/full_name"]'); | ||
const firstNameInput = await $('[name="/concatenate-strings/inputs/first_name"]'); | ||
expect(await fullNameInput.getValue()).to.equal('John Doe'); | ||
|
||
await firstNameInput.setValue('Bruce'); | ||
await fullNameInput.click(); | ||
expect(await fullNameInput.getValue()).to.equal('Bruce Wayne'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters