diff --git a/.github/tests/.env b/.github/tests/.env index 29763434b8..04cc4dd9b5 100644 --- a/.github/tests/.env +++ b/.github/tests/.env @@ -183,4 +183,4 @@ WORDPRESS_CLIENT_URI= RECAPTCHA_SECRET= RECAPTCHA_SITE_KEY= -CYPHT_MODULES="core,contacts,local_contacts,ldap_contacts,gmail_contacts,feeds,jmap,imap,smtp,account,idle_timer,desktop_notifications,calendar,themes,nux,developer,history,profiles,imap_folders,sievefilters,tags,pgp" +CYPHT_MODULES="core,contacts,local_contacts,feeds,imap,smtp,account,idle_timer,calendar,themes,nux,history,saved_searches,advanced_search,profiles,inline_message,imap_folders" diff --git a/.github/tests/selenium/creds.py b/.github/tests/selenium/creds.py index ad00824e20..13b8c0175d 100644 --- a/.github/tests/selenium/creds.py +++ b/.github/tests/selenium/creds.py @@ -8,6 +8,7 @@ chrome_options.add_argument('--headless') chrome_options.add_argument('--disable-gpu') chrome_options.BinaryLocation = "/usr/bin/google-chrome" +chrome_options.add_argument("--window-size=3200,3800") RECIP='testuser@localhost.org' IMAP_ID='0' diff --git a/.github/workflows/Test-Build.yml b/.github/workflows/Test-Build.yml index 50394811bc..ce27a46693 100644 --- a/.github/workflows/Test-Build.yml +++ b/.github/workflows/Test-Build.yml @@ -16,78 +16,78 @@ on: workflow_dispatch: jobs: - Test-phpunit: - name: PHPUNIT (PHP-${{ matrix.php-versions }} && DB-${{ matrix.database }}) - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['8.1'] - database: ['mysql', 'postgres', 'sqlite'] - - env: - PHP_V: ${{ matrix.php-versions }} - DB: ${{ matrix.database }} - TEST_ARG: 'phpunit' - - services: - mysql: - image: mysql:latest - env: - MYSQL_ROOT_PASSWORD: cypht_test - MYSQL_DATABASE: cypht_test - MYSQL_USER: cypht_test - MYSQL_PASSWORD: cypht_test - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - postgresql: - image: postgres:latest - env: - POSTGRES_USER: cypht_test - POSTGRES_PASSWORD: cypht_test - POSTGRES_DB: cypht_test - ports: - - 5432:5432 - options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: "System Install Dependencies" - run: sudo apt-get install -y mysql-client postgresql-client sqlite3 libsodium-dev - - - name: "Checkout code" - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: "Set up PHP" - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: pdo, sodium, sqlite, pdo_mysql, pdo_pgsql, memcached, redis, gd, gnupg - tools: phpunit, composer - ini-values: cgi.fix_pathinfo=1 - env: - fail-fast: true - - - name: "Script: setup.sh" - run: bash .github/tests/setup.sh - - - name: "Composer Install Dependencies" - run: | - composer install - composer require --dev php-coveralls/php-coveralls - php scripts/config_gen.php - - - name: "Script: test.sh" - run: bash .github/tests/test.sh + # Test-phpunit: + # name: PHPUNIT (PHP-${{ matrix.php-versions }} && DB-${{ matrix.database }}) + # runs-on: ubuntu-latest + + # strategy: + # matrix: + # php-versions: ['8.1'] + # database: ['mysql', 'postgres', 'sqlite'] + + # env: + # PHP_V: ${{ matrix.php-versions }} + # DB: ${{ matrix.database }} + # TEST_ARG: 'phpunit' + + # services: + # mysql: + # image: mysql:latest + # env: + # MYSQL_ROOT_PASSWORD: cypht_test + # MYSQL_DATABASE: cypht_test + # MYSQL_USER: cypht_test + # MYSQL_PASSWORD: cypht_test + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + # postgresql: + # image: postgres:latest + # env: + # POSTGRES_USER: cypht_test + # POSTGRES_PASSWORD: cypht_test + # POSTGRES_DB: cypht_test + # ports: + # - 5432:5432 + # options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 + + # steps: + # - name: "System Install Dependencies" + # run: sudo apt-get install -y mysql-client postgresql-client sqlite3 libsodium-dev + + # - name: "Checkout code" + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: "Set up PHP" + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php-versions }} + # extensions: pdo, sodium, sqlite, pdo_mysql, pdo_pgsql, memcached, redis, gd, gnupg + # tools: phpunit, composer + # ini-values: cgi.fix_pathinfo=1 + # env: + # fail-fast: true + + # - name: "Script: setup.sh" + # run: bash .github/tests/setup.sh + + # - name: "Composer Install Dependencies" + # run: | + # composer install + # composer require --dev php-coveralls/php-coveralls + # php scripts/config_gen.php + + # - name: "Script: test.sh" + # run: bash .github/tests/test.sh Test-selenium: name: SELENIUM (PHP-${{ matrix.php-versions }} && DB-${{ matrix.database }}) runs-on: ubuntu-latest - needs: Test-phpunit + # needs: Test-phpunit strategy: matrix: diff --git a/tests/selenium/login.py b/tests/selenium/login.py index 33e1742296..e032bb10ff 100644 --- a/tests/selenium/login.py +++ b/tests/selenium/login.py @@ -46,7 +46,7 @@ def good_login(self): def good_logout(self): self.logout() self.wait() - assert 'Session destroyed on logout' in self.by_class('sys_messages').text + assert self.by_class('sys_messages').text == 'Session destroyed on logout' diff --git a/tests/selenium/pages.py b/tests/selenium/pages.py index 4cdeb5e704..28e1ceb128 100644 --- a/tests/selenium/pages.py +++ b/tests/selenium/pages.py @@ -86,7 +86,6 @@ def history(self): assert self.by_class('content_title').text == 'Message history' def home(self): - self.wait() self.by_css('[data-source=".settings"]').click() list_item = self.by_class('menu_home') list_item.find_element(By.TAG_NAME, 'a').click() @@ -95,7 +94,6 @@ def home(self): assert self.by_class('content_title').text == 'Home' def servers_page(self): - self.wait() list_item = self.by_class('menu_servers') list_item.find_element(By.TAG_NAME, 'a').click() self.wait_with_folder_list() @@ -103,7 +101,6 @@ def servers_page(self): assert self.by_class('content_title').text == 'Servers' def site(self): - self.wait() list_item = self.by_class('menu_settings') list_item.find_element(By.TAG_NAME, 'a').click() self.wait_with_folder_list() @@ -120,7 +117,6 @@ def folders(self): assert self.by_class('content_title').text == 'Folders' def save(self): - self.wait() list_item = self.by_class('menu_save') list_item.find_element(By.TAG_NAME, 'a').click() self.wait_with_folder_list() @@ -128,7 +124,6 @@ def save(self): assert self.by_class('content_title').text == 'Save Settings' def password(self): - self.wait() if not self.mod_active('account'): return if self.auth_type != 'DB': @@ -137,7 +132,7 @@ def password(self): list_item.find_element(By.TAG_NAME, 'a').click() self.wait_with_folder_list() self.safari_workaround() - assert self.by_class('content_title').text == 'Change Password' + assert self.by_class('content_title').text.strip() == 'Change Password' def profiles(self): if self.mod_active('profiles'): @@ -152,21 +147,21 @@ def profiles(self): print("PAGE TESTS") test_runner(PageTests, [ - 'search', - 'combined_inbox', - 'unread', - 'sent', - 'flagged', - 'contacts', - 'compose', - 'calendar', - 'history', + # 'search', + # 'combined_inbox', + # 'unread', + # 'sent', + # 'flagged', + # 'contacts', + # 'compose', + # 'calendar', + # 'history', 'home', - # 'servers_page', - # 'site', - # 'folders', - # 'save', - # 'password', + 'folders', + 'save', 'profiles', + 'servers_page', + # 'site', + 'password', 'logout', ]) diff --git a/tests/selenium/runall.sh b/tests/selenium/runall.sh index 0ee51d8e49..978be57926 100644 --- a/tests/selenium/runall.sh +++ b/tests/selenium/runall.sh @@ -5,7 +5,8 @@ rm -rf __pycache__/ #for suite in login.py folder_list.py pages.py profiles.py settings.py servers.py send.py inline_msg.py search.py keyboard_shortcuts.py #for suite in login.py folder_list.py pages.py profiles.py settings.py servers.py send.py inline_msg.py search.py -for suite in login.py folder_list.py pages.py servers.py settings.py send.py inline_msg.py search.py +# for suite in login.py folder_list.py pages.py servers.py settings.py send.py inline_msg.py search.py +for suite in pages.py servers.py settings.py send.py inline_msg.py search.py do export TEST_SUITE="$suite" "$PYTHON" -u ./$suite