-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Hide 'Add snap account' button behind an experimental setting #20974
Changes from all commits
38d1da5
1c81f39
a2a04c5
576f465
ba8ee07
484a0d3
966a62c
7385401
a48cb74
ffafdd6
fff5e3f
ea90aca
640691b
06873fd
7573e5c
b899129
e607c03
03ac55e
e474aab
373d7f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const { strict: assert } = require('assert'); | ||
const { withFixtures } = require('../helpers'); | ||
const FixtureBuilder = require('../fixture-builder'); | ||
|
||
describe('Add snap account experimental settings', function () { | ||
it('switch "Enable Add snap account" to on', async function () { | ||
await withFixtures( | ||
{ | ||
fixtures: new FixtureBuilder().build(), | ||
title: this.test.title, | ||
failOnConsoleError: false, | ||
}, | ||
async ({ driver }) => { | ||
await driver.navigate(); | ||
await driver.fill('#password', 'correct horse battery staple'); | ||
await driver.press('#password', driver.Key.ENTER); | ||
|
||
// Make sure the "Add snap account" button is not visible. | ||
await driver.clickElement('[data-testid="account-menu-icon"]'); | ||
await driver.assertElementNotPresent({ | ||
text: 'Add snap account', | ||
tag: 'button', | ||
}); | ||
await driver.clickElement('.mm-box button[aria-label="Close"]'); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the ease of troubleshooting potential test failures going forward, will recommend that we consider separating this single block into two. it ('add snap account disabled by default`... |
||
// Navigate to experimental settings. | ||
await driver.clickElement( | ||
'[data-testid="account-options-menu-button"]', | ||
); | ||
await driver.clickElement({ text: 'Settings', tag: 'div' }); | ||
await driver.clickElement({ text: 'Experimental', tag: 'div' }); | ||
|
||
// Switch "Enable Add snap account" to on. | ||
const toggle = await driver.findElement( | ||
'[data-testid="add-snap-account-toggle"]', | ||
); | ||
await driver.scrollToElement(toggle); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could probably turn this into a fixure and save test steps here. |
||
await driver.clickElement('[data-testid="add-snap-account-toggle"]'); | ||
|
||
// Make sure the "Add snap account" button is visible. | ||
await driver.clickElement('[data-testid="account-menu-icon"]'); | ||
assert.equal( | ||
await driver.isElementPresentAndVisible({ | ||
text: 'Add snap account', | ||
tag: 'button', | ||
}), | ||
true, | ||
); | ||
}, | ||
); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line and the next can be replaced by
await unlockWallet(driver);
going forward