Migrates from using findElementWithAssert(
to findOne(
.
Note: only findElementWithAssert(...).get(0)
and findElementWithAssert(...)[0]
forms are able to be migrated at the moment.
npx ember-page-object-codemod find-one path/of/files/ or/some**/*glob.js
# or
yarn global add ember-page-object-codemod
ember-page-object-codemod find-one path/of/files/ or/some**/*glob.js
- default-import
- find-element-with-assert-0
- find-element-with-assert-get-0
- find-element-with-assert
- member-find-element-with-assert-0
Input (default-import.input.js):
import po, { findElementWithAssert } from 'ember-cli-page-object';
function test() {
return po.create();
}
Output (default-import.output.js):
import po from 'ember-cli-page-object';
function test() {
return po.create();
}
Input (find-element-with-assert-0.input.js):
import { findElementWithAssert } from 'ember-cli-page-object';
function testOne(po) {
return findElementWithAssert(po)[0];
}
Output (find-element-with-assert-0.output.js):
import { findOne } from "ember-cli-page-object/extend";
function testOne(po) {
return findOne(po);
}
find-element-with-assert-get-0
Input (find-element-with-assert-get-0.input.js):
import { findElementWithAssert } from 'ember-cli-page-object/extend';
function testOne(po) {
return findElementWithAssert(po).get(0);
}
Output (find-element-with-assert-get-0.output.js):
import { findOne } from 'ember-cli-page-object/extend';
function testOne(po) {
return findOne(po);
}
Input (find-element-with-assert.input.js):
import { findElementWithAssert } from 'ember-cli-page-object';
function testOne(po) {
return findElementWithAssert(po);
}
Output (find-element-with-assert.output.js):
import { findElementWithAssert } from 'ember-cli-page-object';
function testOne(po) {
return findElementWithAssert(po);
}
member-find-element-with-assert-0
Input (member-find-element-with-assert-0.input.js):
import { findElementWithAssert } from 'ember-cli-page-object/extend';
function testOne(po) {
return po.findElementWithAssert(po)[0];
}
Output (member-find-element-with-assert-0.output.js):
function testOne(po) {
return po.findElementWithAssert(po)[0];
}