Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
More intermittent fixes for bookmarks hanger
Browse files Browse the repository at this point in the history
Auditors: @bsclifton
  • Loading branch information
bbondy committed Jan 16, 2017
1 parent 7670206 commit 415e343
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
25 changes: 17 additions & 8 deletions test/components/bookmarksTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe('bookmark tests', function () {
.waitForVisible(navigatorNotBookmarked)
.click(navigatorNotBookmarked)
.waitForVisible(doneButton)
.waitForBookmarkDetail(this.page1Url, 'Page 1')
.waitForEnabled(doneButton)
.click(doneButton)
.moveToObject(navigator)
.waitForVisible(navigatorBookmarked)
Expand All @@ -37,8 +39,8 @@ describe('bookmark tests', function () {

it('fills in the url field', function * () {
yield this.app.client
.waitForExist('#bookmarkLocation input', 500, false)
.getValue('#bookmarkLocation input').should.eventually.be.equal(this.page1Url)
.waitForExist('#bookmarkLocation input')
.waitForBookmarkDetail(this.page1Url, 'Page 1')
})
})

Expand All @@ -64,6 +66,8 @@ describe('bookmark tests', function () {
it('fills in the title field', function * () {
yield this.app.client
.waitForExist('#bookmarkName input')
.waitForBookmarkDetail(this.page1Url, 'Page 1')
.waitForEnabled(doneButton)
.getValue('#bookmarkName input').should.eventually.be.equal('Page 1')
})

Expand All @@ -75,6 +79,8 @@ describe('bookmark tests', function () {
describe('saved with a title', function () {
before(function * () {
yield this.app.client
.waitForBookmarkDetail(this.page1Url, 'Page 1')
.waitForEnabled(doneButton)
.click(doneButton)
})

Expand Down Expand Up @@ -108,19 +114,20 @@ describe('bookmark tests', function () {
Brave.beforeAll(this)

before(function * () {
this.page1Url = Brave.server.url('page_no_title.html')
this.pageNoTitle = Brave.server.url('page_no_title.html')

yield setup(this.app.client)

yield this.app.client
.waitForUrl(Brave.newTabUrl)
.loadUrl(this.page1Url)
.windowParentByUrl(this.page1Url)
.loadUrl(this.pageNoTitle)
.windowParentByUrl(this.pageNoTitle)
.moveToObject(navigator)
.waitForExist(navigatorNotBookmarked)
.moveToObject(navigator)
.click(navigatorNotBookmarked)
.waitForVisible(doneButton + ':not([disabled]')
.waitForBookmarkDetail(this.pageNoTitle, '')
.waitForEnabled(doneButton + ':not([disabled]')
})

it('leaves the title field blank', function * () {
Expand All @@ -137,14 +144,16 @@ describe('bookmark tests', function () {
describe('saved without a title', function () {
before(function * () {
yield this.app.client
.waitForBookmarkDetail(this.pageNoTitle, '')
.waitForEnabled(doneButton)
.click(doneButton)
})
it('displays URL', function * () {
const page1Url = this.page1Url
const pageNoTitle = this.pageNoTitle
yield this.app.client
.waitUntil(function () {
return this.getText('.bookmarkText')
.then((val) => val === page1Url)
.then((val) => val === pageNoTitle)
})
})
describe('and then removed', function () {
Expand Down
4 changes: 4 additions & 0 deletions test/components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,8 @@ describe('navigationBar tests', function () {
.moveToObject(navigator)
.click(navigatorNotBookmarked)
.waitForVisible(doneButton)
.waitForBookmarkDetail(page1Url, 'Page 1')
.waitForEnabled(doneButton)
.click(doneButton)
.waitForExist(navigatorBookmarked)
})
Expand Down Expand Up @@ -1224,6 +1226,8 @@ describe('navigationBar tests', function () {
.moveToObject(navigator)
.click(navigatorNotBookmarked)
.waitForVisible(doneButton)
.waitForBookmarkDetail(page2Url, 'Page 2')
.waitForEnabled(doneButton)
.click(doneButton)
.waitForExist(navigatorBookmarked)
.waitForElementCount(bookmarksToolbar, 0)
Expand Down

1 comment on commit 415e343

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ 😄

Please sign in to comment.