Skip to content

Commit

Permalink
nit: updated order of things
Browse files Browse the repository at this point in the history
  • Loading branch information
dikwickley committed Mar 17, 2024
1 parent bdd93d8 commit f53ad0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions test/src/api/commands/web-element/testGetRect.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('element().getRect() command', function () {
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

it('test .element().getSize()', async function() {
it('test .element().rect()', async function() {
MockServer.addMock({
url: '/session/13521-10219-202/element/0/rect',
method: 'GET',
Expand All @@ -47,7 +47,7 @@ describe('element().getRect() command', function () {
})
}, true);

const resultPromise = this.client.api.element('#signupSection').getSize();
const resultPromise = this.client.api.element('#signupSection').rect();
assert.strictEqual(resultPromise instanceof Element, false);
assert.strictEqual(typeof resultPromise.find, 'undefined');

Expand All @@ -62,7 +62,7 @@ describe('element().getRect() command', function () {
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

it('test .element().getLocation()', async function() {
it('test .element().getSize()', async function() {
MockServer.addMock({
url: '/session/13521-10219-202/element/0/rect',
method: 'GET',
Expand All @@ -71,7 +71,7 @@ describe('element().getRect() command', function () {
})
}, true);

const resultPromise = this.client.api.element('#signupSection').getLocation();
const resultPromise = this.client.api.element('#signupSection').getSize();
assert.strictEqual(resultPromise instanceof Element, false);
assert.strictEqual(typeof resultPromise.find, 'undefined');

Expand All @@ -86,16 +86,16 @@ describe('element().getRect() command', function () {
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

it('test .element().find().getRect()', async function() {
it('test .element().getLocation()', async function() {
MockServer.addMock({
url: '/session/13521-10219-202/element/1/rect',
url: '/session/13521-10219-202/element/0/rect',
method: 'GET',
response: JSON.stringify({
value: {height: 34, width: 443, x: 356, y: 381.5}
})
}, true);

const resultPromise = this.client.api.element('#signupSection').find('#helpBtn').getRect();
const resultPromise = this.client.api.element('#signupSection').getLocation();
assert.strictEqual(resultPromise instanceof Element, false);
assert.strictEqual(typeof resultPromise.find, 'undefined');

Expand All @@ -110,16 +110,16 @@ describe('element().getRect() command', function () {
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

it('test .element.find().getRect()', async function() {
it('test .element().find().getRect()', async function() {
MockServer.addMock({
url: '/session/13521-10219-202/element/0/rect',
url: '/session/13521-10219-202/element/1/rect',
method: 'GET',
response: JSON.stringify({
value: {height: 34, width: 443, x: 356, y: 381.5}
})
}, true);

const resultPromise = this.client.api.element.find('#signupSection').getRect();
const resultPromise = this.client.api.element('#signupSection').find('#helpBtn').getRect();
assert.strictEqual(resultPromise instanceof Element, false);
assert.strictEqual(typeof resultPromise.find, 'undefined');

Expand All @@ -134,7 +134,7 @@ describe('element().getRect() command', function () {
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

it('test .element().rect()', async function() {
it('test .element.find().getRect()', async function() {
MockServer.addMock({
url: '/session/13521-10219-202/element/0/rect',
method: 'GET',
Expand All @@ -143,7 +143,7 @@ describe('element().getRect() command', function () {
})
}, true);

const resultPromise = this.client.api.element('#signupSection').rect();
const resultPromise = this.client.api.element.find('#signupSection').getRect();
assert.strictEqual(resultPromise instanceof Element, false);
assert.strictEqual(typeof resultPromise.find, 'undefined');

Expand All @@ -157,4 +157,5 @@ describe('element().getRect() command', function () {
const resultValue = await resultPromise.value;
assert.deepStrictEqual(resultValue, {height: 34, width: 443, x: 356, y: 381.5});
});

});
2 changes: 1 addition & 1 deletion types/tests/webElement.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ describe('new element() api', function () {
expectType<ElementValue<boolean>>(elem.isDisplayed());

expectType<ElementValue<ScopedElementRect>>(elem.getRect());
expectType<ElementValue<ScopedElementRect>>(elem.rect());
expectType<ElementValue<ScopedElementRect>>(elem.getSize());
expectType<ElementValue<ScopedElementRect>>(elem.getLocation());
expectType<ElementValue<ScopedElementRect>>(elem.rect());

expectType<ElementValue<string>>(elem.getAccessibleName());
expectType<ElementValue<string>>(elem.getAriaRole());
Expand Down

0 comments on commit f53ad0b

Please sign in to comment.