-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve command operator regex (#74)
* Improve command operator regex * Add tests for operator buttons both command and latex string * Added new assertion to check if the operator was properly rendered
- Loading branch information
Showing
3 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
"Is the formula editor visible": function(browser) { | ||
browser | ||
.useXpath() | ||
.url("http://localhost:8000/?&operators=true") | ||
.waitForElementVisible('//*[@id="editor"]') | ||
.click('//button[@class="ql-formula"]') | ||
.waitForElementVisible('//div[@data-mode="formula"]'); | ||
}, | ||
"Is command operator button working": function(browser) { | ||
browser | ||
.useXpath() | ||
.click('//button[@data-value="\\sqrt"]') | ||
.waitForElementVisible('//span[@class="mq-scaled mq-sqrt-prefix"]') | ||
.click('//a[@class="ql-action"]') | ||
.waitForElementVisible('//span[@class="ql-formula"]') | ||
.assert.attributeContains( | ||
'//span[@class="ql-formula"]', | ||
"data-value", | ||
"\\sqrt" | ||
) | ||
.end(); | ||
} | ||
}; |
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,26 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
"Is the formula editor visible": function(browser) { | ||
browser | ||
.useXpath() | ||
.url("http://localhost:8000/?&operators=true") | ||
.waitForElementVisible('//*[@id="editor"]') | ||
.click('//button[@class="ql-formula"]') | ||
.waitForElementVisible('//div[@data-mode="formula"]'); | ||
}, | ||
"Is latex string button working": function(browser) { | ||
browser | ||
.useXpath() | ||
.click('//button[@data-value="\\sqrt[3]{}"]') | ||
.waitForElementVisible('//sup[@class="mq-nthroot mq-non-leaf"]') | ||
.click('//a[@class="ql-action"]') | ||
.waitForElementVisible('//span[@class="ql-formula"]') | ||
.assert.attributeContains( | ||
'//span[@class="ql-formula"]', | ||
"data-value", | ||
"\\sqrt[3]{}" | ||
) | ||
.end(); | ||
} | ||
}; |