Sealing the top of an appliance trap
Normally, in the absence of a laundry sink to route your drain to, a standpipe is used. There are pre-made standpipes available for purchase but I prefer to fashion my own out of larger diameter plastic pipe (PVC or ABS).



The standpipe is designed to hold the large volume of discharged water until it can drain down through the trap. Although there are devices you can buy to seal them up, I do not recommend it as drain siphon issues can come into play.