Skip to content

Removed hardcoded username from Actionlogs.cy.js#44439

Merged
laoneo merged 3 commits intojoomla:5.2-devfrom
pAnd0rASBG:patch-1
Nov 12, 2024
Merged

Removed hardcoded username from Actionlogs.cy.js#44439
laoneo merged 3 commits intojoomla:5.2-devfrom
pAnd0rASBG:patch-1

Conversation

@pAnd0rASBG
Copy link
Copy Markdown
Contributor

@pAnd0rASBG pAnd0rASBG commented Nov 11, 2024

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:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

On line #22 "ci-admin" was hardcoded, causing the test to fail, if another user is configured in cypress.config.mjs
@richard67
Copy link
Copy Markdown
Member

@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.

Using Template Literals to pass JS linting
@pAnd0rASBG
Copy link
Copy Markdown
Contributor Author

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.

…gs/Actionlogs.cy.js

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@pAnd0rASBG
Copy link
Copy Markdown
Contributor Author

Thanks @richard67 👍

@laoneo laoneo merged commit eb07512 into joomla:5.2-dev Nov 12, 2024
@laoneo
Copy link
Copy Markdown
Member

laoneo commented Nov 12, 2024

Thanks!

@laoneo laoneo added this to the Joomla! 5.2.2 milestone Nov 12, 2024
@pAnd0rASBG pAnd0rASBG deleted the patch-1 branch November 12, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants