This commit is contained in:
parent
eb655b24b6
commit
25805a093a
20 changed files with 788 additions and 805 deletions
|
|
@ -28,6 +28,10 @@ module;
|
|||
export module Catcrafts.E2eHarness;
|
||||
import std;
|
||||
import Crafter.Network;
|
||||
// For the compiled-in catalogue: the suites address whatever priced product it
|
||||
// lists rather than a slug written into them, so a listing coming or going is
|
||||
// a content change and not a test edit.
|
||||
import Catcrafts.Shared;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
|
@ -62,6 +66,18 @@ inline std::string ReadFile(const fs::path& p) {
|
|||
return buf.str();
|
||||
}
|
||||
|
||||
// The priced product the goods suites run against: the first non-donation
|
||||
// entry of the compiled catalogue, or nullptr while it lists none — the state
|
||||
// since 2026-09-05, when the two handsets were withdrawn. A suite with goods
|
||||
// checks prints a note and skips them in that case; the donation item keeps
|
||||
// the shared order lifecycle covered regardless.
|
||||
inline const Catcrafts::Product* FirstPricedProduct() {
|
||||
for (const Catcrafts::Product& p : Catcrafts::Content::Products()) {
|
||||
if (!p.donation) return &p;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline std::size_t CountOccurrences(std::string_view haystack, std::string_view needle) {
|
||||
if (needle.empty()) return 0;
|
||||
std::size_t n = 0;
|
||||
|
|
@ -302,9 +318,12 @@ public:
|
|||
return Body(path);
|
||||
}
|
||||
|
||||
// Open shop or coming-soon? The pricing blob (data-cc) exists only on the
|
||||
// real order form, so its presence is the probe.
|
||||
bool ShopOpen() { return Body("/shop/fp6-pmos").find("data-cc=") != std::string::npos; }
|
||||
// Open shop or coming-soon, for one priced product? The pricing blob
|
||||
// (data-cc) exists only on the real order form, so its presence is the
|
||||
// probe.
|
||||
bool ShopOpen(std::string_view slug) {
|
||||
return Body("/shop/" + std::string(slug)).find("data-cc=") != std::string::npos;
|
||||
}
|
||||
|
||||
private:
|
||||
void Spawn(const std::vector<std::string>& argv) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue