travis: try to fix flaky tests

This commit is contained in:
Nolan Lawson 2018-04-10 20:56:42 -07:00
parent 7488eaebd6
commit dac4d120f3
3 changed files with 7 additions and 3 deletions

View File

@ -68,3 +68,5 @@ branches:
cache:
directories:
- $HOME/.npm
- $HOME/.rvm
- $HOME/.bundle

View File

@ -45,6 +45,7 @@ export async function restoreMastodonData () {
let internalIdsToIds = {}
for (let action of actions) {
console.log(JSON.stringify(action))
await new Promise(resolve => setTimeout(resolve, 100)) // sleep because otherwise order may not be preserved
let accessToken = users[action.user].accessToken
if (action.post) {

View File

@ -48,15 +48,15 @@ export const sleep = timeout => new Promise(resolve => setTimeout(resolve, timeo
export const getUrl = exec(() => window.location.href)
export const getActiveElementClass = exec(() =>
document.activeElement ? document.activeElement.getAttribute('class') : ''
(document.activeElement && document.activeElement.getAttribute('class')) || ''
)
export const getActiveElementInnerText = exec(() =>
document.activeElement && document.activeElement.innerText
(document.activeElement && document.activeElement.innerText) || ''
)
export const getActiveElementAriaLabel = exec(() =>
document.activeElement ? document.activeElement.getAttribute('aria-label') : ''
(document.activeElement && document.activeElement.getAttribute('aria-label')) || ''
)
export const getActiveElementInsideNthStatus = exec(() => {
@ -67,6 +67,7 @@ export const getActiveElementInsideNthStatus = exec(() => {
}
element = element.parentElement
}
return ''
})
export const goBack = exec(() => window.history.back())