-
Notifications
You must be signed in to change notification settings - Fork 109
feat: handle assistant sync task #5269
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import { initUserAndFiles, randUser } from '../utils/index.js' | ||
|
|
||
| const currentUser = randUser() | ||
|
|
||
| const fileName = 'empty.md' | ||
|
|
||
| describe('Assistant', () => { | ||
| before(() => { | ||
| initUserAndFiles(currentUser, fileName) | ||
| }) | ||
|
|
||
| beforeEach(() => { | ||
| cy.login(currentUser) | ||
| cy.visit('/apps/files') | ||
| }) | ||
|
|
||
| it('See assistant button', () => { | ||
| cy.isolateTest({ | ||
| sourceFile: fileName, | ||
| }) | ||
| cy.openFile(fileName, { force: true }) | ||
|
|
||
| cy.getContent() | ||
| .click({ force: true }) | ||
|
|
||
| cy.get('[data-cy="assistantMenu"]') | ||
| .should('be.visible') | ||
|
|
||
| cy.get('[data-cy="assistantMenu"]') | ||
| .click() | ||
|
|
||
| cy.get('.action-item__popper ul').children().should(($children) => { | ||
| const entries = $children.find('button').map((i, el) => el.innerText).get() | ||
| expect(entries.length).to.be.greaterThan(0) | ||
| expect('Free prompt').to.be.oneOf(entries) | ||
| expect('Translate').to.be.oneOf(entries) | ||
| expect('Show assistant results').to.be.oneOf(entries) | ||
| }) | ||
| }) | ||
|
|
||
| it('Send free prompt request', () => { | ||
| cy.isolateTest({ | ||
| sourceFile: fileName, | ||
| }) | ||
| cy.openFile(fileName, { force: true }) | ||
|
|
||
| cy.getContent() | ||
| .click({ force: true }) | ||
| cy.get('[data-cy="assistantMenu"]') | ||
| .click() | ||
| cy.get('.action-item__popper ul li').first() | ||
| .click() | ||
|
|
||
| cy.get('.assistant-modal--content #input-prompt') | ||
| .should('be.visible') | ||
|
|
||
| cy.get('.assistant-modal--content #input-prompt') | ||
| .type('Hello World') | ||
| cy.get('.assistant-modal--content .submit-button') | ||
| .click() | ||
|
|
||
| // eslint-disable-next-line cypress/no-unnecessary-waiting | ||
| cy.wait(2000) | ||
|
|
||
| cy.get('.assistant-modal--content .close-button') | ||
| .click() | ||
| cy.get('[data-cy="assistantMenu"]') | ||
| .click() | ||
| cy.get('.action-item__popper ul li').last() | ||
| .click() | ||
|
|
||
| cy.get('.modal-container__content .task-list') | ||
| .should('be.visible') | ||
| .should('contain', 'Hello World') | ||
| }) | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,10 @@ if [ $? -eq 0 ]; then | |
| php /var/www/html/occ user:add --password-from-env user2 | ||
| php /var/www/html/occ app:enable viewer | ||
| php /var/www/html/occ app:enable text | ||
| php /var/www/html/occ app:enable assistant | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was for some way of running isolated cypress tests locally, but never used that script myself. @max-nextcloud Do you happen to know if we still make use of that?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was just for local tests, but nowadays we could use |
||
| php /var/www/html/occ app:enable testing | ||
| php /var/www/html/occ app:list | ||
| " | ||
| fi | ||
|
|
||
| exec $@ | ||
| exec $@ | ||
Uh oh!
There was an error while loading. Please reload this page.