Update collaborate.js

restore-responsiveness-test
John McLear 2021-03-14 10:07:32 +00:00
parent e73a4e79f6
commit beaf2e8f1e
1 changed files with 12 additions and 2 deletions

View File

@ -45,7 +45,7 @@ describe(__filename, () => {
let originalLineCount; let originalLineCount;
cy.visit('http://127.0.0.1:9001/p/collab', {timeout: 120000}); cy.visit('http://127.0.0.1:9001/p/collab', {timeout: 120000});
// Until we find a better way, this is required. // Until we find a better way, this is required.
cy.wait(10000); // wait for Minified JS to be built... cy.wait(20000); // wait for Minified JS to be built...
cy.get('iframe[name="ace_outer"]', {timeout: 120000}).iframe() cy.get('iframe[name="ace_outer"]', {timeout: 120000}).iframe()
.find('iframe[name="ace_inner"]').iframe() .find('iframe[name="ace_inner"]').iframe()
.find('.ace-line:first') .find('.ace-line:first')
@ -72,7 +72,7 @@ describe(__filename, () => {
cy.get('iframe[name="ace_outer"]').iframe() cy.get('iframe[name="ace_outer"]').iframe()
.find('iframe[name="ace_inner"]').iframe() .find('iframe[name="ace_inner"]').iframe()
.find('.ace-line:last') .find('.ace-line:last')
.type(Math.random().toString(36).slice(2)); .type(`${Math.random().toString(36).slice(2)} ${Math.random().toString(36).slice(2)}`);
// shameless copy/pasted from // shameless copy/pasted from
// https://stackoverflow.com/questions/10726909/random-alpha-numeric-string-in-javascript // https://stackoverflow.com/questions/10726909/random-alpha-numeric-string-in-javascript
i++; i++;
@ -90,5 +90,15 @@ describe(__filename, () => {
// line count has grown // line count has grown
expect($inner.find('div').length).to.be.at.least(enterKeyCount + originalLineCount); expect($inner.find('div').length).to.be.at.least(enterKeyCount + originalLineCount);
}); });
// Now make one final edit and make sure it's visible within 10 ms.
cy.get('iframe[name="ace_outer"]').iframe()
.find('iframe[name="ace_inner"]').iframe()
.find('.ace-line:last')
.type(`${Math.random().toString(36).slice(2)} ${Math.random().toString(36).slice(2)}`);
cy.get('iframe[name="ace_outer"]').iframe()
.find('iframe[name="ace_inner"]').iframe()
.find('.ace-line:last', {timeout: 10});
}); });
}); });