Commit b38bdad9 authored by Andreasjj's avatar Andreasjj
Browse files

fixed tests and stuff

parent cc3a99ab
Pipeline #116311 passed with stage
in 11 minutes
......@@ -33,7 +33,7 @@ async function setNext(next) {
}
const url = new URL(next)
const pageNumber = url.searchParams.get('page')
return `${HOST}/api/exercises/?page=${pageNumber}`
return `${HOST}/api/workouts/?page=${pageNumber}`
}
async function fetchWorkouts(ordering) {
......
import requests
import json
from ..constants import REST_API_BASE
......
......@@ -6,9 +6,10 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
from .constants import TEST_ROOT
from .helpers.registration import write_registration_inputs
from .helpers.rest import get_user_tokens, get_workouts, create_exercise
from .helpers.rest import get_user_tokens, get_workouts, create_workout
from selenium.webdriver.support import expected_conditions as EC
import uuid
from datetime import datetime
'''
Integration test for UC-1
......@@ -43,7 +44,7 @@ class InfinityScroll(unittest.TestCase):
# initialization of webdriver
def setUp(self):
firefox_options = webdriver.FirefoxOptions()
#firefox_options.add_argument('-headless')
firefox_options.add_argument('-headless')
firefox_options.add_argument("--width=1920")
firefox_options.add_argument("--height=1080")
self.driver = webdriver.Firefox(firefox_options=firefox_options)
......@@ -59,7 +60,7 @@ class InfinityScroll(unittest.TestCase):
def test(self):
username = str(uuid.uuid4())
# Register user
self.driver.get("%s/workouts.html" % TEST_ROOT)
self.driver.get("%s/register.html" % TEST_ROOT)
write_registration_inputs(
self.driver,
username,
......@@ -80,10 +81,11 @@ class InfinityScroll(unittest.TestCase):
if workoutsCount < 40:
countToMake = 40 - workoutsCount
for i in range(countToMake):
create_workout(tokens['access'], "Test workout(public)", "This is a note", datetime.now(), "PU", "A file!")
print(create_workout(tokens['access'], "Test workout(public)", "This is a note", datetime.now(), "PU", "A file!"))
# Go to the exercies page
self.driver.get("%s/exercises.html" % TEST_ROOT)
self.driver.get("%s/workouts.html" % TEST_ROOT)
self.driver.refresh()
self.wait_for_exercises(self.driver, 10)
self.scroll_to_bottom(self.driver)
......
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
class integration_testing(unittest.TestCase):
# initialization of webdriver
def setUp(self):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--window-size=1420,1080')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
self.driver = webdriver.Chrome(chrome_options=chrome_options)
def test(self):
self.driver.get("http://localhost:3000")
print("hi")
def tearDown(self):
self.driver.close()
\ No newline at end of file
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
class system_testing(unittest.TestCase):
# initialization of webdriver
def setUp(self):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--window-size=1420,1080')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
self.driver = webdriver.Chrome(chrome_options=chrome_options)
def test(self):
self.driver.get("http://localhost:3000")
print("hi")
def tearDown(self):
self.driver.close()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment