validate input

pull/5370/head
filip mertens 11 months ago
parent d3ed2be4b9
commit bca8a532e4
  1. 2
      .circleci/config.yml
  2. 10
      apps/remix-ide-e2e/src/commands/validateValueInput.ts
  3. 2
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts

@ -3,7 +3,7 @@ version: 2.1
parameters: parameters:
run_flaky_tests: run_flaky_tests:
type: boolean type: boolean
default: false default: true
orbs: orbs:
browser-tools: circleci/browser-tools@1.4.4 browser-tools: circleci/browser-tools@1.4.4
win: circleci/windows@5.0 win: circleci/windows@5.0

@ -7,18 +7,16 @@ class ValidateValueInput extends EventEmitter {
browser.perform((done) => { browser.perform((done) => {
browser browser
.clearValue(selector) .clearValue(selector)
.execute((selector) => { .click(selector)
(document.querySelector(selector) as any).focus()
}, [selector], () => { })
.setValue(selector, valueTosSet) .setValue(selector, valueTosSet)
.pause(500)
.execute(function (selector) { .execute(function (selector) {
const elem = document.querySelector(selector) as HTMLInputElement const elem = document.querySelector(selector) as HTMLInputElement
return elem.value return elem.value
}, [selector], function (result) { }, [selector], function (result) {
browser.assert.equal(result.value, expectedValue) browser.assert.equal(result.value, expectedValue)
}) }).perform(() => { done() ;this.emit('complete') })
done()
this.emit('complete')
}) })
return this return this
} }

@ -22,7 +22,7 @@ module.exports = {
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
}, },
'Should load run and deploy tab and check value validation #group1': function (browser: NightwatchBrowser) { 'Should load run and deploy tab and check value validation #flaky #group1': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
.validateValueInput('*[data-id="dandrValue"]', '999', '999') .validateValueInput('*[data-id="dandrValue"]', '999', '999')

Loading…
Cancel
Save