Skip to content

Commit

Permalink
test debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mercihabam authored and josaphatim committed Oct 16, 2024
1 parent a2c27c0 commit 645d414
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 75 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/Test-Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 tests/phpunit/run.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 tests/phpunit/run.sh


Test-selenium:
name: SELENIUM (PHP-${{ matrix.php-versions }} && DB-${{ matrix.database }})
runs-on: ubuntu-latest
needs: Test-phpunit
# needs: Test-phpunit

strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ protected function output() {
$changed = 1;
}

return '<div class="modal fade" id="confirmLogoutModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirmLogoutModalLabel" aria-hidden="true">
return '<input type="hidden" id="unsaved_changes" value="'.$changed.'" /><div class="modal fade" id="confirmLogoutModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirmLogoutModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
Expand Down
14 changes: 7 additions & 7 deletions modules/core/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -1482,14 +1482,14 @@ var Hm_Utils = {
},

confirm_logout: function() {
if (! $('#unsaved_changes').length || $('#unsaved_changes').val() == 0) {
// if (! $('#unsaved_changes').length || $('#unsaved_changes').val() == 0) {
document.getElementById('logout_without_saving').click();
}
else {
var confirmLogoutModal = new bootstrap.Modal(document.getElementById('confirmLogoutModal'), {keyboard: true})
confirmLogoutModal.show();
$('.confirm_logout').show();
}
// }
// else {
// var confirmLogoutModal = new bootstrap.Modal(document.getElementById('confirmLogoutModal'), {keyboard: true})
// confirmLogoutModal.show();
// $('.confirm_logout').show();
// }
return false;
},

Expand Down
4 changes: 4 additions & 0 deletions tests/selenium/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def __init__(self, cap=None):
if 'browserName' in self.driver.capabilities:
self.browser = self.driver.capabilities['browserName'].lower()
self.load()
# Change the window size to make sure all elements are visible
current_size = self.driver.get_window_size()
new_height = 5000
self.driver.set_window_size(current_size['width'], new_height)

def read_ini(self):
self.modules = []
Expand Down

0 comments on commit 645d414

Please sign in to comment.