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

Add cypress tests for shortcut to save comments #10644

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,2 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL scanning - action"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 22 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp', 'javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- if: matrix.language == 'cpp'
name: Install dependencies
run: |
sudo sh -c "echo deb-src http://archive.ubuntu.com/ubuntu/ noble main restricted >> /etc/apt/sources.list"
sudo sh -c "echo deb-src http://archive.ubuntu.com/ubuntu/ noble-updates main restricted >> /etc/apt/sources.list"
sudo sh -c "echo deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted >> /etc/apt/sources.list"
sudo sh -c "echo deb-src http://security.ubuntu.com/ubuntu/ noble-security universe >> /etc/apt/sources.list"
sudo sh -c "echo deb-src http://security.ubuntu.com/ubuntu/ noble-security multiverse >> /etc/apt/sources.list"
sudo apt-get update
sudo apt install -y libunwind-dev
sudo apt-get install -y build-essential git libpoco-dev libcap-dev python3-polib npm libpng-dev python3-lxml libpam-dev libzstd-dev libssl-dev libcppunit-dev

- if: matrix.language == 'cpp'
name: Configure
run: |
cd .. && wget https://github.com/CollaboraOnline/online/releases/download/for-code-assets/core-co-24.04-assets.tar.gz
tar xvf core-co-24.04-assets.tar.gz && rm core-co-24.04-assets.tar.gz && export LOCOREPATH=$(pwd)
cd online && ./autogen.sh
./configure --enable-silent-rules --with-lokit-path=${LOCOREPATH}/include --with-lo-path=${LOCOREPATH}/instdir --enable-debug
cd browser && npm update

- if: matrix.language == 'cpp'
name: Build
run: make -j `nproc` build-nocheck

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
21 changes: 21 additions & 0 deletions cypress_test/integration_tests/desktop/calc/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
cy.cGet('#comment-container-1').should('exist');
});

it('Modify and Save using shortcut Ctrl+Enter', function() {
// Given an open comment edit dialog
desktopHelper.insertComment();
cy.cGet('#comment-container-1').should('exist');
cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
cy.cGet('#comment-container-1').trigger('mouseover');
cy.cGet('#annotation-content-area-1').should('contain','some text');
cy.cGet('#comment-annotation-menu-1').click();
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');

// When Ctrl+Enter is hit
cy.cGet('annotation-modify-textarea-1').type('{ctrl}{enter}');

// Then, the dialog is closed and the comment content should be updated
cy.cGet('#comment-container-1').should('not.exist');
});

it('Reply should not be possible', function() {
desktopHelper.insertComment();

Expand Down
17 changes: 17 additions & 0 deletions cypress_test/integration_tests/desktop/writer/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
cy.cGet('#annotation-content-area-1').should('contain','some text0, some other text');
});

it('Modify and Save using shortcut Ctrl+Enter', function() {
// Given an open comment edit dialog
desktopHelper.insertComment();
cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('contain','some text0');
cy.cGet('#comment-annotation-menu-1').click();
cy.cGet('body').contains('.context-menu-item', 'Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');

// When Ctrl+Enter is hit
cy.cGet('annotation-modify-textarea-1').type('{ctrl}{enter}');

// Then, the dialog is closed and the comment content is updated
cy.cGet('.cool-annotation-content-wrapper').should('not.exist');
cy.cGet('#annotation-content-area-1').should('contain','some other text, some text0');
});

it('Reply', function() {
desktopHelper.insertComment();

Expand Down