What was the first comedy play?
Among Western tradition, the earliest known comedy plays were Greek (Old Comedy), most notably the works of Aristophanes, 446-385 BCE (punctuated by lots of dirty jokes and vulgar attire on the part of the actors--yes, bathroom humor has always been in style). His known plays are: Wasps, The Frogs, The Acharnians, Clouds, Birds, Ecclesiazusae, Peace, The Wasps, and Lysistrata.
The Greeks also had satyr plays, which punctuated their tragedies at the great festivals, and were designed to lighten the mood. They had men dressed as goats with phallic props, and featured mock drunkenness, sexuality, pranks, and physical comedy. They date back at least to 500 BCE.
However, depending on how you define "theatre," there were earlier plays which included humor (satire) in Egyptian culture from the reign of Ramses V (1149 – 1145 BC). One such play was Contendings of Horus and Seth, a play which, while it didn't have a "proper" theatrical venue, it was also peppered with off-color jokes and outright bawdiness.