Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions tests/001.simba
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
## Inventory Tests
Tests the integrety of several inventory methods.
Tests the integrity of several inventory methods.
*)
{$DEFINE WL_TEST}
{$I WaspLib/osrs.simba}
Expand All @@ -25,7 +25,6 @@ begin
Assert(Inventory.IsOpen());
Assert(Inventory.Slots.Count() = 11);
Assert(Inventory.Slots.CountEmpty() = 17);
Assert(Inventory.Slots.CountEmpty() = 17);
Assert(Inventory.Items.Contains('Air rune'));
Assert(Inventory.Items.Contains('Super attack(4)'));
Assert(Inventory.Slots.ReadStack(2) = 1);
Expand Down
2 changes: 1 addition & 1 deletion tests/002.simba
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
# Login Tests
Tests the integrety of several login methods.
Tests the integrity of several login methods.
*)
{$DEFINE WL_TEST}
{$I WaspLib/osrs.simba}
Expand Down
2 changes: 1 addition & 1 deletion tests/003.simba
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
## Bank Tests
Tests the integrety of several bankpin and bank methods.
Tests the integrity of several bankpin and bank methods.
*)
{$DEFINE WL_TEST}
{$I WaspLib/osrs.simba}
Expand Down
56 changes: 56 additions & 0 deletions tests/004.simba
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(*
## Make Tests
Tests the integrity of several Make interface methods.
*)
{$DEFINE WL_TEST}
{$I WaspLib/osrs.simba}
{$ASSERTIONS ON}

const
PATH: String = {$MACRO DIR} + 'imgs' + PATH_SEP;
MODES: TStringArray = ['fixed', 'resizable_classic', 'resizable_modern_small', 'resizable_modern_large'];
FILENAME: String := PATH_SEP + PathExtractNameWithoutExt(SCRIPT_FILE);
var
mode: String;
img: TImage;
begin
for mode in MODES do
begin
// Test 004.png - Basic Make interface with 5 items, 6 quantity buttons, 6 selected
img := new TImage(PATH + mode + FILENAME + '.png');
Target.SetImage(img);
WaspLibSetup();

Assert(Make.IsOpen());
Assert(Length(Make.GetItemBoxes()) = 5);

Assert(Length(Make.GetQuantityBoxes()) = 6);
Assert(Length(Make.FindQuantityButtons) = 6);
Assert(Make.GetCurrentQuantity() = 6);
Assert(Make.HasHint() = False);

// Test 004-1.png - Make interface with hint tooltip showing
img := new TImage(PATH + mode + FILENAME + '-1.png');
Target.SetImage(img);

WaspLibSetup();

Assert(Make.IsOpen());
Assert(Make.HasHint());
Assert(Make.ReadHint().Contains('Willow longbow'));
Assert(Length(Make.GetItemBoxes()) = 5);

// Test 004-2.png - Different Make interface with 1 item, 3 quantity buttons
img := new TImage(PATH + mode + FILENAME + '-2.png');
Target.SetImage(img);

WaspLibSetup();

Assert(Make.IsOpen());
Assert(Length(Make.GetItemBoxes()) = 1);
Assert(Length(Make.GetQuantityBoxes()) = 3);
Assert(Length(Make.FindQuantityButtons) = 3);
Assert(Make.GetCurrentQuantity() = 10);
Assert(Make.HasHint() = False);
end;
end;
Binary file modified tests/imgs/fixed/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/imgs/resizable_classic/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/imgs/resizable_modern_large/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/imgs/resizable_modern_small/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.