Open yashaka opened 5 years ago
import { Browser, have, perform } from 'selenidejs'; let browser: Browser; describe('TodoMVC', () => { beforeAll(async () => { browser = Browser.chrome(); jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000; }); afterAll(async () => { await browser.quit(); }); it('completes task', async () => { await browser.open("http://todomvc.com/examples/emberjs/"); await browser.element('//*[@id="new-todo"]').type('a').then(perform.pressEnter); await browser.element('//*[@id="new-todo"]').type('b').then(perform.pressEnter); await browser.element('//*[@id="new-todo"]').type('c').then(perform.pressEnter); await browser.all('//*[@id="new-todo"]//li').should(have.exactTexts('a', 'b', 'c')); }); });
fails with:
1) TodoMVC completes task Message: Error: Timed out after 4000ms, while waiting for: browser.all(By(xpath, //*[@id="new-todo"]//li)).has exact texts a,b,c Reason: Cannot read property 'includes' of undefined Stack: Error: Timed out after 4000ms, while waiting for: browser.all(By(xpath, //*[@id="new-todo"]//li)).has exact texts a,b,c Reason: Cannot read property 'includes' of undefined at <Jasmine> at processTicksAndRejections (internal/process/next_tick.js:81:5) 1 spec, 1 failure Finished in 8.89 seconds
It should fail actually, because the //*[@id="new-todo"]//li selector is wrong (should be todo-list instead of new-todo), but the error is unclear...
//*[@id="new-todo"]//li
maybe the reason is somewhere here: https://github.com/KnowledgeExpert/selenidejs/blob/master/lib/utils/predicates.ts#L25
the fix is needed:)
reproduced in branch: https://github.com/KnowledgeExpert/selenidejs/tree/new-not-syntax-for-conditions
as far as I see, query.text returns empty array, which is fine, and I wasn't able to figure out how compare actually works, so please take this one @yashaka
query.text
fails with:
It should fail actually, because the
//*[@id="new-todo"]//li
selector is wrong (should be todo-list instead of new-todo), but the error is unclear...maybe the reason is somewhere here: https://github.com/KnowledgeExpert/selenidejs/blob/master/lib/utils/predicates.ts#L25
the fix is needed:)
reproduced in branch: https://github.com/KnowledgeExpert/selenidejs/tree/new-not-syntax-for-conditions