If any man's wife commits adultery with another man, and it is hidden from the eyes of her husband, and there are no witnesses against her, or if a husband is jealous of his wife, and she had indeed committed adultery, or if a husband is jealous of his wife, and she did not commit adultery, then shall the man bring his wife to the shaman, and he shall bring her offering for her, the tenth part of a measure of barley meal; he shall pour no oil upon it, nor shall he put frankincense on it; for it is an offering of jealousy, a memorial offering, recalling sin.
The shaman shall bring her near, and set her before the altar and shall take holy water in an earthen vessel; and the shaman shall take the dust that is in the floor of the shrine and put it into the water, and the shaman shall set the woman before the altar, and uncover the woman's head, and put the memorial offering in her hands, which is the jealousy offering and the shaman shall have in his hand the bitter water that causes the curse and the shaman place the woman under oath and say to the woman:
If you have not committed adultery, you will be immune to this bitter water that causes the curse. But if you have committed adultery then the spirits curse you, and this water that causes the curse shall go into your bowels, and make you miscarry or have a stillbirth.
And the woman shall say, "Let it be so."
And the shaman shall write these curses in a book, and he shall blot them out with the bitter water. And he shall cause the woman to drink the bitter water that causes the curse and it shall enter into her, and become bitter.
Then the shaman shall take the jealousy offering out of the woman's hand, and shall wave the offering before the altar, and offer it upon the altar and the priest shall take an handful of the offering, even the memorial of it, and burn it upon the altar, and then shall have the woman to drink the water. And when he has made her drink the water, then if she had committed adultery, the water that causes the curse shall enter into her, and become bitter, and shall will miscarry or have a stillbirth, and the woman shall be a curse among her people. And if the woman has not committed adultery, then she will be free, and shall carry her pregnancy to term and give birth to a healthy child.
This is the law of jealousies. Then shall the man be guiltless from sin, and this woman shall bear her sin.
Numbers 5:12-5:31 (replacing the word "shaman" with "priest", "shrine" with "tabernacle", "Let it be so" for "Amen", and "Lord" with "altar" where appropriate (and "Lord" for "spirits" when "altar" is not appropriate), and using modern language).
Yes, the Jewish people during the phase of their culture described in the legendary history of the Exodus period in the Torah, really were superstitious nomadic herders who believed in crazy magic.
Stylistically, the process has much in common with Bronze Age Hittite religious practice.
Such trials by ordeal, of course, did nothing to reveal the truth, unless if forced a confession from a guilty wife who believed it would work, but if believed by the husband, it at least resolved the conflict authoritatively from the husband's perspective, legitimatizing some cuckoldry and tarnishing the reputation of some innocent wives. Also, on average, the exonerated women would tend to be more healthy and fertile than those condemned, rightly or wrongly.
Trial by ordeal, was not, of course, unique to early Iron Age Jews. Even after the Romans adopted a more rational system of justice, trial by ordeal was common among the barbarian tribes and gains restored vitality into the early modern era (perhaps into the 16th century or so), in part from that source.