Skip to content

Commit

Permalink
Add postfix to servers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadow243 committed May 8, 2024
1 parent f8165bf commit 38ae5c3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ phpunit_tests() {
}

selenium_tests() {
cp .github/tests/selenium/creds.py tests/selenium/
cd tests/selenium/ && sh ./runall.sh && cd ../../
}

Expand All @@ -18,7 +19,7 @@ case "$ARG" in
phpunit)
phpunit_tests
;;
ui)
selenium)
selenium_tests
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@
| Handles page layout, login/logout, and the default settings pages. This set
| is required.
*/
'modules' => explode(',', env('CYPHT_MODULES','core,contacts,local_contacts,ldap_contacts,gmail_contacts,feeds,jmap,imap,smtp,account,idle_timer,desktop_notifications,calendar,themes,nux,developer,imap_folders')),
'modules' => explode(',', env('CYPHT_MODULES','core,contacts,local_contacts,feeds,imap,smtp,account,idle_timer,calendar,themes,nux,developer,history,saved_searches,advanced_search,highlights,profiles,inline_message,imap_folders,keyboard_shortcuts')),
// 'modules' => [
// /*
// | ----
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/modules/core/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ public function test_msgs() {
$test = new Output_Test('msgs', 'core');
$test->handler_response = array('router_login_state' => false);
$res = $test->run();
$this->assertEquals(array('<div class="d-none z-3 position-fixed top-0 end-0 mt-3 me-3 sys_messages logged_out"><div class="alert alert-danger alert-dismissible fade show" role="alert"><i class="bi bi-exclamation-triangle me-2"></i><span class="danger" id="sys_messages">foo</span>,<div class="alert alert-success alert-dismissible fade show" role="alert"><i class="bi bi-check-circle me-2"></i><span class="info" id="sys_messages">foo</span><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div></div>'), $res->output_response);
$this->assertEquals(array('<div class="d-none position-fixed top-0 end-0 mt-3 me-3 sys_messages logged_out"><div class="alert alert-danger alert-dismissible fade show" role="alert"><i class="bi bi-exclamation-triangle me-2"></i><span class="danger" id="sys_messages">foo</span>,<div class="alert alert-success alert-dismissible fade show" role="alert"><i class="bi bi-check-circle me-2"></i><span class="info" id="sys_messages">foo</span><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div></div>'), $res->output_response);
}
/**
* @preserveGlobalState disabled
Expand Down
3 changes: 2 additions & 1 deletion tests/selenium/runall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 settings.py servers.py send.py inline_msg.py search.py
# for suite in login.py folder_list.py pages.py settings.py servers.py send.py inline_msg.py search.py
for suite in login.py servers.py
do
export TEST_SUITE="$suite"
"$PYTHON" -u ./$suite
Expand Down
25 changes: 20 additions & 5 deletions tests/selenium/servers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import subprocess
from time import sleep
from base import WebTest, USER, PASS
from selenium.webdriver.common.by import By
Expand Down Expand Up @@ -76,8 +77,22 @@ def server_jmap_add(self):
if __name__ == '__main__':

print("SERVERS TEST")
test_runner(ServersTest, [
'load_servers_page',
'server_stmp_and_imap_add',
'server_jmap_add'
])
# Check if postfix service is active
result = subprocess.run(['sudo', 'systemctl', 'is-active', 'postfix.service'], capture_output=True, text=True)
postfix_status = result.stdout.strip()
if postfix_status == "active":
test_runner(ServersTest, [
'load_servers_page',
'server_stmp_and_imap_add',
'server_jmap_add'
])
else:
print("Postfix service is not active")
subprocess.run(['sudo', 'bash', './../../.github/tests/scripts/postfix.sh'])
# Rerun the tests after running postfix.sh
print("Rerunning SERVERS TEST...")
test_runner(ServersTest, [
'load_servers_page',
'server_stmp_and_imap_add',
'server_jmap_add'
])

0 comments on commit 38ae5c3

Please sign in to comment.