Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add multiple house delivery #1611

Merged
merged 35 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b247c50
add "add house" button
evemartin May 9, 2024
da9e08a
add additional houses
evemartin May 10, 2024
aa66566
add ability to delete houses
evemartin May 10, 2024
ae396ec
fix typos
evemartin May 13, 2024
8a376cc
write test
evemartin May 13, 2024
ea3e76f
debug test
evemartin May 13, 2024
fcb1b37
debug test
evemartin May 13, 2024
1209738
debug test
evemartin May 13, 2024
808ed68
debug test
evemartin May 13, 2024
ebd9640
debug test
evemartin May 13, 2024
367ebc2
debug test
evemartin May 13, 2024
ea74b0b
debug test
evemartin May 13, 2024
9d3e77d
debug test
evemartin May 13, 2024
65f5b85
debug test
evemartin May 13, 2024
fbd9f67
debug test
evemartin May 13, 2024
369bd59
debug test
evemartin May 13, 2024
a5bf94c
debug test
evemartin May 14, 2024
175b9a1
debug test
evemartin May 14, 2024
7f48010
debug test
evemartin May 14, 2024
036e267
fix typo
evemartin May 14, 2024
25a3535
debug test
evemartin May 14, 2024
3769f24
test a change to the test
evemartin May 14, 2024
70020f2
fix bug with deleting houses
evemartin May 14, 2024
f200632
fix typo
evemartin May 14, 2024
92c82ae
debug test
evemartin May 14, 2024
20237eb
make start not deletable
evemartin May 15, 2024
c861f83
address PR comments
evemartin May 15, 2024
c2607ea
debug test
evemartin May 15, 2024
fe499bc
rewrite test
evemartin May 15, 2024
197176a
test new test
evemartin May 15, 2024
ed28d08
debug test
evemartin May 15, 2024
aece2b8
debug test
evemartin May 15, 2024
3a8bd2c
debug test again
evemartin May 15, 2024
7696c5a
fix typo
evemartin May 15, 2024
e717985
Merge branch 'master' into add-multiple-house-delivery
faucomte97 May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions game/end_to_end_tests/test_level_editor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By

from game.end_to_end_tests.base_game_test import BaseGameTest
from game.views.level_editor import available_blocks

Expand All @@ -17,3 +20,27 @@ def test_code_tab_blocks_load(self):
for block_type in block_types:
assert page.element_exists_by_id(f"{block_type}_checkbox")
assert page.element_exists_by_id(f"{block_type}_image")

def test_multiple_houses(self):
add_road_button = self.selenium.find_element(By.ID, "add_road")
add_road_button.click()

road_start = self.selenium.find_element(By.CSS_SELECTOR, "rect[x='130'][y='530']")
road_end = self.selenium.find_element(By.CSS_SELECTOR, "rect[x='330'][y='530']")
ActionChains(self.selenium).drag_and_drop(road_start, road_end).perform()

add_house_button = self.selenium.find_element(By.ID, "add_house")
add_house_button.click()
ActionChains(self.selenium).move_to_element(road_start).click().perform()
ActionChains(self.selenium).move_to_element(road_end).click().perform()

added_houses = self.selenium.find_elements(By.CSS_SELECTOR, "rect[fill='#0000ff']")
assert len(added_houses) == 2

delete_house_button = self.selenium.find_element(By.ID, "delete_house")
delete_house_button.click()
ActionChains(self.selenium).move_to_element(road_end).click().perform()
ActionChains(self.selenium).move_to_element(road_start).perform()

houses_after_delete = self.selenium.find_elements(By.CSS_SELECTOR, "rect[fill='#0000ff']")
assert len(houses_after_delete) == 1
26 changes: 26 additions & 0 deletions game/static/game/image/icons/add_house.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions game/static/game/image/icons/delete_house.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions game/static/game/image/icons/destination.svg

This file was deleted.

Loading
Loading