build-docker.yml: Fix docker release missing latest tags

test: Fix usage of deprecated selenium API functions
This commit is contained in:
thecalcaholic 2022-07-12 22:57:55 +02:00
parent 7207a22e3e
commit 85a4c7e0e2
4 changed files with 20 additions and 16 deletions

View File

@ -137,7 +137,9 @@ jobs:
do
docker pull "thecalcaholic/ncp-internal-${arch}:${{ github.run_id }}"
docker tag "thecalcaholic/ncp-internal-${arch}:${{ github.run_id }}" "ownyourbits/nextcloudpi-${arch}:${version?}"
docker tag "ownyourbits/nextcloudpi-${arch}:${version?}" "ownyourbits/nextcloudpi-${arch}:latest"
docker push "ownyourbits/nextcloudpi-${arch}:${version?}"
docker push "ownyourbits/nextcloudpi-${arch}:latest"
done
docker manifest create ownyourbits/nextcloudpi:${version?} \

View File

@ -1,3 +1,4 @@
[v1.48.1](https://github.com/nextcloud/nextcloudpi/tree/v1.48.1) (2022-06-12) Fix docker release missing latest tags
[v1.48.0](https://github.com/nextcloud/nextcloudpi/tree/v1.48.0) (2022-06-12) Update Nextcloud to version 23.0.6
[v1.47.2](https://github.com/nextcloud/nextcloudpi/commit/b66ce17) (2022-05-05) docker-build.yml: Add CI/CD integration tests for docker images

View File

@ -101,8 +101,8 @@ def test_activation(IP, nc_port, admin_port, options):
driver.get(f"https://{IP}:{nc_port}")
test.check("NextCloudPi Activation" in driver.title)
try:
ncp_pass = driver.find_element_by_id("ncp-pwd").get_attribute("value")
nc_pass = driver.find_element_by_id("nc-pwd").get_attribute("value")
ncp_pass = driver.find_element(By.ID, "ncp-pwd").get_attribute("value")
nc_pass = driver.find_element(By.ID, "nc-pwd").get_attribute("value")
config = configparser.ConfigParser()
if not config.has_section('credentials'):
@ -114,7 +114,7 @@ def test_activation(IP, nc_port, admin_port, options):
with open(test_cfg, 'w') as configfile:
config.write(configfile)
driver.find_element_by_id("activate-ncp").click()
driver.find_element(By.ID, "activate-ncp").click()
test.report("activation click", True)
except:
ncp_pass = ""
@ -123,7 +123,7 @@ def test_activation(IP, nc_port, admin_port, options):
test.new("activation ends")
try:
wait = WebDriverWait(driver, wait_timeout)
wait.until(EC.text_to_be_present_in_element((By.ID,'error-box'), "ACTIVATION SUCCESSFUL"))
wait.until(EC.text_to_be_present_in_element((By.ID, 'error-box'), "ACTIVATION SUCCESSFUL"))
test.check(True)
except TimeoutException:
test.check(False)

View File

@ -24,6 +24,8 @@ from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.service import Service
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import NoSuchElementException, WebDriverException, TimeoutException
@ -104,10 +106,9 @@ class ConfigTestFailure(Exception):
pass
def test_nextcloud(IP, nc_port, driver):
def test_nextcloud(IP: str, nc_port: str, driver: WebDriver):
""" Login and assert admin page checks"""
test = Test()
print(driver.desired_capabilities['timeouts'])
test.new("nextcloud page")
try:
driver.get(f"https://{IP}:{nc_port}/index.php/settings/admin/overview")
@ -119,12 +120,12 @@ def test_nextcloud(IP, nc_port, driver):
trusted_domain_str = "You are accessing the server from an untrusted domain"
test.report("trusted domain", trusted_domain_str not in driver.page_source)
try:
driver.find_element_by_id("user").send_keys(nc_user)
driver.find_element_by_id("password").send_keys(nc_pass)
driver.find_element_by_id("submit-form").click()
driver.find_element(By.ID, "user").send_keys(nc_user)
driver.find_element(By.ID, "password").send_keys(nc_pass)
driver.find_element(By.ID, "submit-form").click()
except NoSuchElementException:
try:
driver.find_element_by_id("submit").click()
driver.find_element(By.ID, "submit").click()
except NoSuchElementException:
pass
@ -137,22 +138,22 @@ def test_nextcloud(IP, nc_port, driver):
(By.CSS_SELECTOR, "#security-warning-state-warning"),
(By.CSS_SELECTOR, "#security-warning-state-error")]))
element_ok = driver.find_element_by_id("security-warning-state-ok")
element_warn = driver.find_element_by_id("security-warning-state-warning")
element_ok = driver.find_element(By.ID, "security-warning-state-ok")
element_warn = driver.find_element(By.ID, "security-warning-state-warning")
if element_warn.is_displayed():
if driver.find_element_by_css_selector("#postsetupchecks > .errors").is_displayed() \
or driver.find_element_by_css_selector("#postsetupchecks > .warnings").is_displayed():
if driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors").is_displayed() \
or driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .warnings").is_displayed():
raise ConfigTestFailure("There have been errors or warnings")
infos = driver.find_elements_by_css_selector("#postsetupchecks > .info > li")
infos = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .info > li")
for info in infos:
if re.match(r'.*Your installation has no default phone region set.*', info.text):
continue
else:
php_modules = info.find_elements_by_css_selector("li")
php_modules = info.find_elements(By.CSS_SELECTOR, "li")
if len(php_modules) != 1:
raise ConfigTestFailure(f"Could not find the list of php modules within the info message "
f"'{infos[0].text}'")