Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades code-mirror, browsermob-proxy and mouse-trap #6940

Merged
merged 33 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update e2e Tests
  • Loading branch information
NishealJ committed Jun 25, 2019
commit 9987c2aa99a585d4f5b618dc6dfed7363ad72cbe
10 changes: 5 additions & 5 deletions core/tests/protractor_desktop/explorationHistoryTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('Exploration history', function() {
highlighted: true
},
48: {
text: ' ',
text: '',
highlighted: false
}
};
Expand Down Expand Up @@ -390,7 +390,7 @@ describe('Exploration history', function() {
highlighted: true
},
31: {
text: ' ',
text: '',
highlighted: false
}
};
Expand Down Expand Up @@ -428,7 +428,7 @@ describe('Exploration history', function() {
' translations_mapping:\n' +
' content: {}\n' +
' default_outcome: {}\n' +
' ';
'';

var expectedHistoryStates = [{
label: 'first (was: Introd...',
Expand All @@ -451,7 +451,7 @@ describe('Exploration history', function() {
historyGraph.closeStateHistory();

historyGraph.openStateHistory('second');
historyGraph.expectTextToMatch(STATE_2_STRING, ' ');
historyGraph.expectTextToMatch(STATE_2_STRING, '');
historyGraph.closeStateHistory();

// Reset all checkboxes.
Expand Down Expand Up @@ -486,7 +486,7 @@ describe('Exploration history', function() {
historyGraph.expectNumberOfLinksToMatch(3, 1, 2);

historyGraph.openStateHistory('second');
historyGraph.expectTextToMatch(' ', STATE_2_STRING);
historyGraph.expectTextToMatch('', STATE_2_STRING);
historyGraph.closeStateHistory();

// Check renaming a state.
Expand Down
4 changes: 2 additions & 2 deletions core/tests/protractor_utils/ExplorationEditorHistoryTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ var ExplorationEditorHistoryTab = function() {
expectTextToMatch: function(v1StateContents, v2StateContents) {
forms.CodeMirrorChecker(
element.all(by.css('.CodeMirror-code')).first()
).expectTextToBe(v1StateContents);
).expectTextToBe(v1StateContents, 'first()');
NishealJ marked this conversation as resolved.
Show resolved Hide resolved
forms.CodeMirrorChecker(
element.all(by.css('.CodeMirror-code')).last()
).expectTextToBe(v2StateContents);
).expectTextToBe(v2StateContents, 'last()');
},
/*
* This function compares regular/highlighted text contents of 2
Expand Down
11 changes: 7 additions & 4 deletions core/tests/protractor_utils/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,15 +624,17 @@ var CodeMirrorChecker = function(elem) {
* - 'checked': true or false, whether the line has been checked
*/
var _compareTextFromLine = function(
currentLineNumber, scrollTo, compareDict) {
currentLineNumber, scrollTo, Pane, compareDict) {
NishealJ marked this conversation as resolved.
Show resolved Hide resolved
browser.executeScript(
"$('.CodeMirror-vscrollbar').first().scrollTop(" + String(scrollTo) +
"$('.CodeMirror-vscrollbar')."+ Pane +".scrollTop(" + String(scrollTo) +
');');
elem.getText().then(function(text) {
// The 'text' arg is a string 2n lines long representing n lines of text
// codemirror has loaded. The (2i)th line contains a line number and the
// (2i+1)th line contains the text on that line.
var textArray = text.split('\n');
//Adding an empty line at the last.
textArray[textArray.length]='';
for (var i = 0; i < textArray.length; i += 2) {
var lineNumber = textArray[i];
var lineText = textArray[i + 1];
Expand All @@ -647,6 +649,7 @@ var CodeMirrorChecker = function(elem) {
_compareTextFromLine(
largestLineNumber,
scrollTo + CODEMIRROR_SCROLL_AMOUNT_IN_PIXELS,
Pane,
compareDict);
} else {
for (var dictLineNumber in compareDict) {
Expand Down Expand Up @@ -680,7 +683,7 @@ var CodeMirrorChecker = function(elem) {
* Compares text with codemirror. The input should be a string (with
* line breaks) of the expected display on codemirror.
*/
expectTextToBe: function(expectedTextString) {
expectTextToBe: function(expectedTextString, Pane) {
var expectedTextArray = expectedTextString.split('\n');
var expectedDict = {};
for (var lineNumber = 1; lineNumber <= expectedTextArray.length;
Expand All @@ -690,7 +693,7 @@ var CodeMirrorChecker = function(elem) {
checked: false
};
}
_compareTextFromLine(1, 0, expectedDict);
_compareTextFromLine(1, 0, Pane, expectedDict);
}
};
};
Expand Down