Diagnosis often involves a combination of patient history, physical examinations, and specific tests. A polysomnography (sleep study) is the most definitive test for diagnosing sleep apnea. This overnight test measures various physiological parameters during sleep, such as brain waves, blood oxygen levels, heart rate, and breathing patterns.