joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

Removed hardcoded username from Actionlogs.cy.js #44439

Closed pAnd0rASBG closed 1 week ago

pAnd0rASBG commented 1 week ago

On line 22 "ci-admin" was hardcoded, causing the test to fail, if another user is configured in cypress.config.mjs

Summary of Changes

replaced ci-admin with Cypress.env('username')

Testing Instructions

Configure cypress.config.mjs to user other than "ci-admin"

Actual result BEFORE applying this Pull Request

"can display a list of actions" will fail due to "ci-admin" not being found in log

Expected result AFTER applying this Pull Request

Test will pass, due to searching for the actual username

Link to documentations

Please select:

richard67 commented 1 week ago

@pAnd0rASBG Could you check and fix the javascript codestyle error reported by Drone here https://ci.joomla.org/joomla/joomla-cms/80258/1/20 ?

npm run lint:js

> joomla@5.2.2 lint:js
> eslint --config build/.eslintrc --ignore-pattern '/media/' --ext .es6.js,.es6,.vue .

+ npm run lint:testjs

> joomla@5.2.2 lint:testjs
> eslint --config build/.eslintrc --ext .js tests/System

/drone/src/tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js
  22:17  error  Unexpected string concatenation  prefer-template

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.
pAnd0rASBG commented 1 week ago

I changed the Syntax to not use the concatenation Drone was complaining about. However - I don't see why it's failing now with "Unexpected token username" as this is the Variable from Cypress' config and the test works perfectly like that.

pAnd0rASBG commented 1 week ago

Thanks @richard67 👍

laoneo commented 1 week ago

Thanks!