Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests): Implement testing for new template workflow (filling templates) #3885

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

elzody
Copy link
Contributor

@elzody elzody commented Aug 6, 2024

Summary

This PR fixes the existing cypress tests in templates.spec.js, and introduces new tests to cover the additions to the template workflow; namely filling templates.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@elzody elzody added enhancement New feature or request 2. developing Work in progress javascript Pull requests that update Javascript code tests feature: templates labels Aug 6, 2024
@elzody elzody added this to the Nextcloud 30 milestone Aug 6, 2024
@elzody elzody requested a review from juliusknorr August 6, 2024 15:13
@elzody elzody self-assigned this Aug 6, 2024
@elzody elzody marked this pull request as ready for review August 6, 2024 20:33
cypress/e2e/templates.spec.js Outdated Show resolved Hide resolved
@juliusknorr
Copy link
Member

the release runner failure looks unrelated, but the nightly-3 failure seems related:


  1) Create templates with fields
       Create a document from a template with fields:
     AxiosError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

  > Request failed with status code 500

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.

{"reqId":"hK4q7ZxHIeZs7FJ2wVMm","level":3,"time":"2024-08-06T22:59:40+00:00","remoteAddr":"10.1.0.40","user":"fvyhvslz","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/files/api/v1/templates","message":"Call to a member function getStorage() on null in file '/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Service/TemplateFieldService.php' line 48","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/13.13.2 Chrome/118.0.5993.159 Electron/27.3.10 Safari/537.36","version":"30.0.0.6","exception":{"Exception":"Exception","Message":"Call to a member function getStorage() on null in file '/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Service/TemplateFieldService.php' line 48","Code":0,"Trace":[{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/runner/work/richdocuments/richdocuments/ocs/v1.php","line":43,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/ocs/v2.php","line":7,"args":["/home/runner/work/richdocuments/richdocuments/ocs/v1.php"],"function":"require_once"}],"File":"/home/runner/work/richdocuments/richdocuments/lib/private/AppFramework/Http/Dispatcher.php","Line":146,"Previous":{"Exception":"Error","Message":"Call to a member function getStorage() on null","Code":0,"Trace":[{"file":"/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Listener/BeforeGetTemplatesListener.php","line":29,"function":"extractFields","class":"OCA\\Richdocuments\\Service\\TemplateFieldService","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/EventDispatcher/ServiceEventListener.php","line":68,"function":"handle","class":"OCA\\Richdocuments\\Listener\\BeforeGetTemplatesListener","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/EventDispatcher/EventDispatcher.php","line":67,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/EventDispatcher/EventDispatcher.php","line":79,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/Files/Template/TemplateManager.php","line":209,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/Files/Template/TemplateManager.php","line":123,"function":"getTemplateFiles","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"function":"OC\\Files\\Template\\{closure}","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/Files/Template/TemplateManager.php","line":125,"function":"array_map"},{"file":"/home/runner/work/richdocuments/richdocuments/apps/files/lib/Controller/TemplateController.php","line":44,"function":"listTemplates","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"list","class":"OCA\\Files\\Controller\\TemplateController","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/runner/work/richdocuments/richdocuments/ocs/v1.php","line":43,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/runner/work/richdocuments/richdocuments/ocs/v2.php","line":7,"args":["/home/runner/work/richdocuments/richdocuments/ocs/v1.php"],"function":"require_once"}],"File":"/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Service/TemplateFieldService.php","Line":48},"message":"Call to a member function getStorage() on null in file '/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Service/TemplateFieldService.php' line 48","exception":{},"CustomMessage":"Call to a member function getStorage() on null in file '/home/runner/work/richdocuments/richdocuments/apps/richdocuments/lib/Service/TemplateFieldService.php' line 48"}}

@juliusknorr
Copy link
Member

Let's wait for #3890 to see what tests actually fail on which collabora container

@juliusknorr juliusknorr merged commit fc61bdb into main Aug 15, 2024
66 checks passed
@juliusknorr juliusknorr deleted the test/template-filling branch August 15, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement New feature or request feature: templates javascript Pull requests that update Javascript code tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add Cypress testing to cover new template workflow (filling templates)
2 participants