Repository: nightwatchjs/nightwatch (js)

Issue:
Add aliases for `getCssProperty` command in new Element API
### Description

The `getCssProperty` should have the following alias 
- css 
- getCssValue 

The `getCssProperty` can be found in the `lib/api/web-element/commands` directory. 

### TODO 

- [ ] Add missing aliases 
- [ ] Add tests for the added aliases
- [ ] Add missing types and tests for the added types 



### Suggested solution

_No response_

### Alternatives / Workarounds

_No response_

### Additional Information

_No response_

Pull request:
Feat: added `.css()` and `.getCssValue()` as an  alias for `.getCssProperty()`
fixes #4167 

Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.

- [.] Before marking your PR for review, please test and verify your changes by making appropriate modifications to any of the Nightwatch example tests (present in `examples/tests` directory of the project) and running them. `ecosia.js` and `duckDuckGo.js` are good examples to work with.
- [.] Create a new branch from master (e.g. `features/my-new-feature` or `issue/123-my-bugfix`);
- [.] If you're fixing a bug also create an issue if one doesn't exist yet;
- [ ] If it's a new feature explain why do you think it's necessary. Please check with the maintainers beforehand to make sure it is something that we will accept. Usually we only accept new features if we feel that they will benefit the entire community;
- [ ] Please avoid sending PRs which contain drastic or low level changes. If you are certain that the changes are needed, please discuss them beforehand and indicate what the impact will be;
- [ ] If your change is based on existing functionality please consider refactoring first. Pull requests that duplicate code will most likely be ignored;
- [ ] Do not include changes that are not related to the issue at hand;
- [ ] Follow the same coding style with regards to spaces, semicolons, variable naming etc.;
- [ ] Always add unit tests - PRs without tests are most of the times ignored.


Patch:
diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js
index 539e0127..ee0aae19 100644
--- a/lib/api/web-element/scoped-element.js
+++ b/lib/api/web-element/scoped-element.js
@@ -27,7 +27,7 @@ class ScopedWebElement {
       'getText': ['text'],
       'getTagName': ['tagName'],
       'getAccessibleName': ['accessibleName'],
-      'getCssProperty': ['css'],
+      'getCssProperty': ['css', 'getCssValue'],
       'getAriaRole': ['ariaRole'],
       'isVisible': ['isDisplayed']
     };
diff --git a/types/web-element.d.ts b/types/web-element.d.ts
index f2e6de63..90ddf1ef 100644
--- a/types/web-element.d.ts
+++ b/types/web-element.d.ts
@@ -188,6 +188,8 @@ export interface ScopedElement extends Element, PromiseLike<WebElement> {
   ariaRole(): ElementValue<string>;
 
   getCssProperty(name: string): ElementValue<string>;
+  css(name: string): ElementValue<string>;
+  getCssValue(name: string): ElementValue<string>;
 
   getValue(): ElementValue<string | null>;
 


Test patch:
diff --git a/test/src/api/commands/web-element/testGetCssProperty.js b/test/src/api/commands/web-element/testGetCssProperty.js
index 3a29befa..fc474399 100644
--- a/test/src/api/commands/web-element/testGetCssProperty.js
+++ b/test/src/api/commands/web-element/testGetCssProperty.js
@@ -63,6 +63,30 @@ describe('element().getCssProperty() command', function () {
     assert.strictEqual(resultValue, '150px');
   });
 
+  it('test .element().getCssValue() alias', async function() {
+    MockServer.addMock({
+      url: '/session/13521-10219-202/element/0/css/height',
+      method: 'GET',
+      response: JSON.stringify({
+        value: '150px'
+      })
+    }, true);
+
+    const resultPromise = this.client.api.element('#signupSection').getCssValue('height');
+    assert.strictEqual(resultPromise instanceof Element, false);
+    assert.strictEqual(typeof resultPromise.find, 'undefined');
+    
+    assert.strictEqual(resultPromise instanceof Promise, false);
+    assert.strictEqual(typeof resultPromise.then, 'function');
+
+    const result = await resultPromise;
+    assert.strictEqual(result instanceof WebElement, false);
+    assert.strictEqual(result, '150px');
+
+    const resultValue = await resultPromise.value;
+    assert.strictEqual(resultValue, '150px');
+  });
+
   it('test .element().find().getCssProperty()', async function() {
     MockServer.addMock({
       url: '/session/13521-10219-202/element/1/css/height',
@@ -135,4 +159,5 @@ describe('element().getCssProperty() command', function () {
     assert.strictEqual(await resultPromise.assert.not.contains('150x'), '150px');
     assert.strictEqual(await resultPromise.assert.not.matches(/150[a-z]{2}x/), '150px');
   });
+  
 });
diff --git a/types/tests/webElement.test-d.ts b/types/tests/webElement.test-d.ts
index 17b58b6e..4cd24eb6 100644
--- a/types/tests/webElement.test-d.ts
+++ b/types/tests/webElement.test-d.ts
@@ -167,6 +167,8 @@ describe('new element() api', function () {
     expectType<ElementValue<string>>(elem.getAriaRole());
     expectType<ElementValue<string>>(elem.ariaRole());
     expectType<ElementValue<string>>(elem.getCssProperty('height'));
+    expectType<ElementValue<string>>(elem.css('height'));
+    expectType<ElementValue<string>>(elem.getCssValue('height'));
     expectType<ElementValue<string>>(elem.takeScreenshot());
 
     expectType<Promise<WebElement>>(elem.click());